PaaS
This guide is for the Django backend. Pair it with Frontend Hosting. Railway is an example, not a required or tested EstateHub integration; equivalent PaaS services can use the same application requirements.
1. Create the backend and database services
Connect your repository, create a backend service rooted at backend/, and provision PostgreSQL. Give the database a dedicated user and configure the five DB_* fields from the service connection details. Restrict database exposure to the application network where your provider allows it. See Railway's monorepo guide for root-directory setup.
2. Set production variables
Set DJANGO_SETTINGS_MODULE=core.settings.prod, unique SECRET_KEY and PLATFORM_CONFIG_ENCRYPTION_KEY, database fields, exact ALLOWED_HOSTS, HTTPS CORS_ALLOWED_ORIGINS and CSRF_TRUSTED_ORIGINS, PUBLIC_API_BASE_URL, and EMAIL_FRONTEND_URL. Add storage and email credentials for features you enable. Use the full checklist.
Use a production Daphne startup command for the backend. Bind to the port supplied by your PaaS. For a shell-based start command:
exec daphne -b 0.0.0.0 -p "${PORT:-8000}" core.asgi:applicationIf the provider starts directly from the Dockerfile, configure its start command to launch Daphne. Railway's start-command documentation explains Docker image overrides and environment-variable expansion.
3. Prepare each release
Run python manage.py check --deploy --settings=core.settings.prod and resolve applicable warnings. Run python manage.py migrate --settings=core.settings.prod once per release. Run collectstatic in the final image or persistent release filesystem before serving requests. A PaaS pre-deploy command can run a migration, but its filesystem changes may not be present in the running container; do not put collectstatic there unless your provider guarantees the output is retained. See Railway pre-deploy commands.
For multiple backend processes, configure and test shared Channels and cache backends first. Add Redis and a Celery worker only for workflows that actually enqueue tasks. The current settings leave the shared Channels/cache alternatives disabled.
4. Expose and test the API
Attach an HTTPS API domain, confirm your proxy forwards the original scheme correctly, and test redirects and secure cookies with core.settings.prod. The current settings do not define SECURE_PROXY_SSL_HEADER, so a TLS-terminating proxy requires a reviewed configuration change before launch. Set a health check to /health/; if your provider probes with a separate hostname, include that hostname in ALLOWED_HOSTS or use a supported health-check configuration. Railway health checks use healthcheck.railway.app as the request host.
Confirm /health/ and an actual /api/v1 request, then deploy the frontend. Refer back to Production Deployment for backups, security, and release verification.