Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask Ubuntu Server Not Running
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Server Error with parse_args() using Flask NoNameoN 0 1,063 Jul-30-2022, 09:42 AM
Last Post: NoNameoN
Question [Solved] Running Gunicorn with flask.... SpongeB0B 1 1,588 Jun-27-2022, 03:09 PM
Last Post: SpongeB0B
  [split] flask 500 internal server error DarthTensor 3 3,946 Nov-11-2021, 06:10 AM
Last Post: DarthTensor
Question running Flask with waitress having web traffic log... SpongeB0B 2 5,788 May-06-2021, 07:07 AM
Last Post: SpongeB0B
Question Flask, Self-hosted deployment, which server ? SpongeB0B 1 2,958 Apr-11-2021, 11:29 AM
Last Post: snippsat
  Running Flask web on other IP than 127.0.0.1 popolon59 1 2,092 Mar-29-2020, 10:02 AM
Last Post: Larz60+
  Flask not running python interpreter from virtual env Charles1 1 2,230 Nov-22-2019, 05:09 PM
Last Post: Larz60+
  Running simple flask - getting 404 beginner1 2 5,267 Oct-28-2019, 02:10 PM
Last Post: beginner1
  Running flask run produces error. Charles1 1 4,028 Oct-04-2019, 10:38 PM
Last Post: snippsat
  Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet) Drone4four 2 9,030 Jan-26-2018, 06:44 AM
Last Post: Drone4four

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020