Runtime
Python 3.12
Framework
Django + Gunicorn
Database
PostgreSQL 17
Process
systemd
Start Building (Quickstart)
- SSH:
ssh root@172.233.72.10 - Upload code via SFTP / FileZilla / Cyberduck: host=
172.233.72.10, user=root, target=/opt/myapp_django/ - Ownership:
chown -R appuser:appuser /opt/myapp_django - Install:
sudo -iu appuser→cd /opt/myapp_django→uv sync→uv run python manage.py migrate→uv run python manage.py collectstatic --noinput - Restart:
exit→systemctl restart myapp_django
Operate (root)
Service status
systemctl status myapp_djangoApp logs
journalctl -u myapp_django -fAdmin URL
https://mxbhkimtest0422django.mycafe24.com/admin/DB env
sudo cat /etc/myapp_django/envReference (paths & configs)
Runtime
Python 3.12 (system) with uv (Astral) for project envs.Build tool
uv sync / uv add by default. pip + venv also works: python -m venv .venv then source .venv/bin/activate.Django project
/opt/myapp_django/myapp_django/ (settings.py, urls.py, wsgi.py). manage.py at /opt/myapp_django/manage.py.Settings
/opt/myapp_django/myapp_django/settings.pyService file
/etc/systemd/system/myapp_django.service (User=appuser, WorkingDirectory=/opt/myapp_django)ExecStart
uv run --directory /opt/myapp_django gunicorn -c /opt/myapp_django/gunicorn.conf.py myapp_django.wsgi:applicationGunicorn config
/opt/myapp_django/gunicorn.conf.py (workers=2, threads=2, bind 127.0.0.1:8000)DB env file
/etc/myapp_django/env — loaded by systemd via EnvironmentFile=; read in settings.py via os.environ (DATABASE_URL).Static files
collectstatic writes to STATIC_ROOT in settings.py. Nginx serves /static/ directly when configured.App port
8000 (Gunicorn bind). Nginx reverse-proxies :80 / :443 → :8000.Logs
journalctl -u myapp_django -f (Gunicorn stdout). Access/error logs also under /var/log/myapp_django/ per gunicorn.conf.py.Redeployupload new source →
sudo -iu appuser → cd /opt/myapp_django → uv sync → uv run python manage.py migrate → uv run python manage.py collectstatic --noinput → exit → systemctl restart myapp_django