-
-
Save ldonjibson/83aff959fc5cf3b32e30d58f8710a6a1 to your computer and use it in GitHub Desktop.
Simple systemd unit for running a django app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment