Artificial intelligent assistant

Is Running a uWSGI/Gunicorn Server on Boot Possible w/ a venv? I have a small .py/Flask application that I can run from the command line as a uWSGI or Gunicorn Server. Flask's site shows an abbreviated way to simply run a Flask app w/ these types of servers, i.e. esp. if I am using my source in a venv. Do you know how to run a uWSGI server or Gunicorn server under a venv on boot? I am basically running some simple source to test out servers for Flask applications and Python3.

> Do you know how to run a uWSGI server or Gunicorn server under a venv on boot?

You have to create an virtual environment and **hardcode the path** to uWSGI or Gunicorn.

To start the app on boot, use _systemd_ or _supervisor_.

An example of using supervisor.


# content from /etc/supervisor/conf.d/microblog.conf

[program:microblog]
command=/home/ubuntu/microblog/venv/bin/gunicorn -b localhost:8000 -w 4 microblog:app
directory=/home/ubuntu/microblog
user=ubuntu
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true


Check Miguel's tutorial about Deployment on Linux for detail.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d5515775a5bba7a25a9212b1baa4ff83