Deployment¶
Purpose¶
Run the platform in production safely.
How it works¶
- Set production env vars (see
.env.example). DJANGO_SETTINGS_MODULE=mkpworks.settings.production- PostgreSQL via
DATABASE_URL - Build docs, then collect static assets:
mkdocs build
python manage.py safe_migrate # migrate --fake-initial + recover DuplicateTable
python manage.py collectstatic --noinput
- Gunicorn:
mkpworks.wsgi:application
Replit Autoscale uses Gunicorn on $PORT. The publish run command calls safe_migrate so deploys succeed when tables already exist but django_migrations is behind (schema sync / restore). Prefer SECURE_SSL_REDIRECT=false behind Replit’s proxy (SECURE_PROXY_SSL_HEADER is set). Enable HSTS only after HTTPS is verified (SECURE_HSTS_SECONDS).
Built documentation is served at /documentation/ from the site/ directory produced by mkdocs build.