Deploying Gobarau Academy Backend to a production environment requires several changes from the default development configuration. The currentDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/muhammadbugaje/gobarau_backend/llms.txt
Use this file to discover all available pages before exploring further.
settings.py ships with a hardcoded secret key, DEBUG = True, an empty ALLOWED_HOSTS, and a local SQLite database — none of which are appropriate for a live server. Work through this checklist in order before exposing the application to the internet.
Pre-Deployment Checklist
Replace the SECRET_KEY
Generate a new cryptographically strong secret key and store it in an environment variable. Never hardcode it in source control.Generate a key with Python:Then update
settings.py to read it from the environment:Disable DEBUG
Set Or read it from an environment variable:
DEBUG to False in your production settings. When DEBUG is True, Django exposes full stack traces to the browser — a serious information leak in production.Configure ALLOWED_HOSTS
Add every hostname and IP address your application will be served from. Django will reject requests that do not match this list when
DEBUG = False.Enable CORS
corsheaders is already installed. Add CorsMiddleware to MIDDLEWARE before CommonMiddleware, then configure the allowed origins:Switch to a production database
The default SQLite configuration is not suitable for production workloads. Replace it with PostgreSQL:Install the PostgreSQL adapter:
Configure Cloudinary
Gobarau Academy uses Cloudinary for media storage. Provide your credentials via environment variables and add the storage configuration to
settings.py:Collect static files
Before starting the production server, collect all static assets into Make sure
STATIC_ROOT:STATIC_ROOT is set in settings.py:Environment Variables
Store all sensitive configuration values as environment variables. Never commit them to source control.| Variable | Description |
|---|---|
SECRET_KEY | Django secret key — long random string |
DEBUG | Set to False in production |
ALLOWED_HOSTS | Comma-separated list of allowed hostnames |
DATABASE_URL | PostgreSQL connection string (e.g. postgres://user:pass@host:5432/dbname) |
CLOUDINARY_CLOUD_NAME | Your Cloudinary cloud name |
CLOUDINARY_API_KEY | Your Cloudinary API key |
CLOUDINARY_API_SECRET | Your Cloudinary API secret |
WSGI / ASGI
The project ships with bothgobarau/wsgi.py and gobarau/asgi.py, generated automatically by django-admin startproject. For most deployments, use Gunicorn against the WSGI entrypoint:
gobarau.asgi:application:
CORS Configuration
corsheaders (django-cors-headers 4.9.0) is already installed. The only remaining step is wiring it into MIDDLEWARE and declaring your allowed origins.
Add CorsMiddleware to MIDDLEWARE — it must appear before CommonMiddleware: