Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple systemd unit for running a django app
# start / stop / restart / status
systemctl start test
systemctl stop test
systemctl restart test
systemctl status test
# logs use journalctl:
# tail the logs for unit `django`
journalctl -f -u django
[Unit]
Description=Unit for starting a basic Django app
[Service]
Restart=on-failure
WorkingDirectory=/var/www/hello
ExecStart=/srv/env/bin/gunicorn hello.wsgi -b 0.0.0.0:8000
[Install]
WantedBy=multi-user.target
@clbarnes

This comment has been minimized.

Copy link

@clbarnes clbarnes commented Feb 3, 2021

How would you express a dependency on a database? I'm struggling with the combination of factors After, Requres, BindsTo, PartOf etc....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment