Score:0

How do I configure uwsgi as a production WSGI server?

tr flag

I have a flask app that I want to run using uwsgi. I am also managing the uwsgi with supervisor. here is the my supervisor.conf file

[program:myapp]
command=/opt/python_envs/apps/bin/uwsgi --ini /opt/apps/myapp_wsgi.ini
stdout_logfile=/var/log/supervisor/program_myapp.log
stderr_logfile=/var/log/supervisor/program_myapp.error
numprocs=1
autostart=true
autorestart=true
startretries=5
user=root
environment=PATH='/opt/python_envs/apps/bin'
directory=/opt/apps

Here is the myapp_wsgi.ini

[uwsgi]
chdir = /opt/apps/myapp
http = :8880
module = myapp:app
enable-threads = true
master = true
processes = 2
uid=root
gid=www-data
socket = myapp.sock
chmod-socket = 660
vacuum = true
need-app = true
die-on-term = true
logger = file:/opt/apps/myapp/logs/uwsgi.log

The problem is that when supervisor starts I see in /var/log/supervisor/program_myapp.log

 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on

I understand that this is Flask's development server's warning message. How do I use production WSGI server Instead?

Michael Hampton avatar
cz flag
https://flask.palletsprojects.com/en/2.0.x/deploying/
Hussain Nagri avatar
tr flag
@MichaelHampton I tried The uWSGI HTTP/HTTPS router as well. Same result.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.