Configuring UWSGI with Python, Django, and NGINX

Revision as of 12:37, 1 November 2020 by Bpopp (talk | contribs)

1. Create a service in /etc/systemd/system/uwsgi.service

[Unit]
Description=uWSGI Emperor service

[Service]
ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown www-data:www-data /run/uwsgi'
#ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
#ExecStart=/usr/local/bin/uwsgi --http 0.0.0.0:8001 --wsgi-file stocks/wsgi.py --master -b 30000 --enable-threads --processes 4 --threads 2
ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target