Python Forum

Full Version: Flask Ubuntu Server Not Running
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've just started making a flask application on an ubuntu server in azure
[Image: qSWwODV.png]
Whenever I start the uwsgi server with "sudo systemctl start uwsgi_items_rest" it gives no error but when I try to go to the URL, it doesn't connect.
This issue has been going on for 2 days and I haven't found any fixes.


What the Nginx file config looks like and it is in sites-available and sites-enabled

------------------------------------------------

server {
listen 80;
real_ip_header X-Forwarded-For;
set_real_ip_from 127.0.0.1;
server_name localhost;

location / {
include uwsgi_params;
uwsgi_pass unix:/var/www/html/items-rest/socket.sock;
uwsgi_modifier1 30;
}

error_page 404 /404.html;
location = 404.html {
root /usr/share/nginx/html;
}

error_page 500 502 503 504 50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
------------------------------------------------

this is the uwsgi service

------------------------------------------------

[Unit]
Description=uWSGI items rest

[Service]
Environment=DATABASE_URL=postgres://MYUSER:MYPASS@localhost:5432/MYUSER
ExecStart=/var/www/html/items-rest/venv/bin/uwsgi --master --emperor /var/www/html/items-rest/uwsgi.ini --die-on-term --uid MYUSER --gid MYUSER --logto /var/www/html/items-rest/log/emperor.log
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target

------------------------------------------------

And the uwsgi.ini file

------------------------------------------------

[uwsgi]
base = /var/www/html/items-rest
app = run
module = %(app)

home = %(base)/venv
pythonpath = %(base)

socket = %(base)/socket.sock

chmod-socket = 777

processes = 8

threads = 8

harakiri = 15

callable = app

logto = /var/www/html/items-rest/log/%n.log

------------------------------------------------

run is how I start my app file
app is my main file that runs everything
and app is the flask variable in the app file

You can see all the non ubuntu specific files here: https://github.com/NeilAgar/test-repos Note: the uwsgi.ini file isn't updated, you can see it above