Derry Spann | {hostname}

Get started guide to using UWSGI

Install uwsgi package run uwsgi --socket 0.0.0.0:20443 --protocol=http -w wsgi:application

create an ini for handling the uwsgi server

[uwsgi]
# Assign the python application to the wsgi module to be called when server is running
module = wsgi:application

# Start Wsgi Master process and worker processes which serves the requests
master = true
processes = 5

# Create a secure socket file connection for nginx to proxy requests
socket = serve_uwsgi.sock
chmod-socket = 600
vacuum = true

# Ensures the uwsgi server ends when the system fails
die-on-term = true

Auto start uWsgi when system boots

[Unit]
Description=uWSGI instance to serve pycasso app
After=network.target

[Service]
User=hyperadmin
Group=www-data
WorkingDirectory=/home/hyperadmin/apps/port_derry
Environment="PATH=/root/.pyenv/bin"
ExecStart=/root/.pyenv/bin/uwsgi --ini serve_uwsgi.ini

[Install]
WantedBy=multi-user.target