Skip to content

Deployment

Purpose

Run the platform in production safely.

How it works

  1. Set production env vars (see .env.example).
  2. DJANGO_SETTINGS_MODULE=mkpworks.settings.production
  3. PostgreSQL via DATABASE_URL
  4. Build docs, then collect static assets:
mkdocs build
python manage.py safe_migrate   # migrate --fake-initial + recover DuplicateTable
python manage.py collectstatic --noinput
  1. 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.