[systemd] Add django service

This commit is contained in:
2026-03-08 17:50:03 -04:00
parent b5cd8724f6
commit 43f6625756
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,17 @@
[Unit]
Description=Django dev server for %I
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
EnvironmentFile=%h/.local/etc/django/%i.env
ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && exec direnv exec "$DJANGO_PATH" poetry run python -u manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}'
Restart=on-failure
RestartSec=2
StandardOutput=append:/tmp/django.log
StandardError=inherit
[Install]
WantedBy=default.target