[Unit] Description=pobsync Django control panel After=network-online.target Wants=network-online.target [Service] Type=simple User=@POBSYNC_USER@ Group=@POBSYNC_GROUP@ WorkingDirectory=@POBSYNC_APP_DIR@ EnvironmentFile=@POBSYNC_ENV_FILE@ Environment=POBSYNC_ENV_FILE=@POBSYNC_ENV_FILE@ Environment=POBSYNC_SERVICE_USER=@POBSYNC_USER@ Environment=POBSYNC_SERVICE_GROUP=@POBSYNC_GROUP@ ExecStartPre=@POBSYNC_VENV_DIR@/bin/python manage.py migrate --noinput ExecStartPre=@POBSYNC_VENV_DIR@/bin/python manage.py collectstatic --noinput --clear ExecStart=/bin/sh -c 'exec @POBSYNC_VENV_DIR@/bin/gunicorn pobsync_server.wsgi:application --bind "${POBSYNC_WEB_BIND:-127.0.0.1:8010}" --workers "${POBSYNC_GUNICORN_WORKERS:-2}" --timeout "${POBSYNC_GUNICORN_TIMEOUT:-120}"' Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target