Django apps
What Kubana detects in a Django repository, what it adds to your settings, static files, migrations and the secret key.
Django apps are backends on App Platform. Kubana reads your repository to find how to install and start the app, then builds it for you, so you don’t need a Dockerfile or any change to your settings.
What Kubana detects
There is nothing to configure. When you select a branch, Kubana reads it and shows how it will run your app in Configuration > How Kubana runs your app:
- The project: the folder with
manage.py, at the repository root or up to two folders below thepyproject.toml,requirements.txtorPipfilethat lists Django. - Settings: the
DJANGO_SETTINGS_MODULEthatmanage.pysets. When it points to development settings (local,dev,test) and aproductionorprodmodule sits next to them, as in cookiecutter-django, Kubana uses the production one. - Server: gunicorn for WSGI apps. For Channels or an
ASGI_APPLICATION, daphne when it’s installed, else uvicorn. Kubana installs the server if your dependencies don’t list it. SetWEB_CONCURRENCYto run more workers. - Package manager and Python version: the same as for FastAPI apps: uv, Poetry, PDM, Pipenv or pip, and Python 3.11 to 3.14 from
.python-versionorrequires-python. - Health check: a
health/,healthz/,up/orping/route in your root URLconf, or django-health-check’s URLs. Without one, Kubana answers/_kubana/upitself once Django has started.
Kubana detects again on every deploy. Use Detect again to check before deploying.
What Kubana adds to your settings
Your app runs through a small Kubana settings module that loads your own settings, then only fills in what is missing. It never replaces a value you set.
ALLOWED_HOSTS: your app’s domains, including custom domains as soon as you add them. If it already contains"*", it stays as is.CSRF_TRUSTED_ORIGINS:https://plus each domain, so forms and the admin work.SECURE_PROXY_SSL_HEADER: HTTPS ends at Kubana’s proxy, so Django learns the request was secure fromX-Forwarded-Proto.- Static files:
STATIC_ROOTwhen you haven’t set one, and WhiteNoise to serve the files, unless you already use WhiteNoise or store static files in S3.
manage.py commands, cron jobs and post-deployment commands use the same settings.
Projects with class-based settings (django-configurations) run with their own settings only. Kubana lists what to add in its warnings.
Static files and frontend builds
Kubana runs collectstatic while it builds your app. If your settings need real environment variables to load (for example env("DATABASE_URL") with no default), the build log says so, and the app collects them when it starts instead.
When your project has a package.json with a build script, for example theme/static_src from django-tailwind or a Vite frontend, Kubana runs it with npm, pnpm, Yarn or Bun before collectstatic. django-tailwind’s standalone mode runs manage.py tailwind build. If Kubana finds several frontends, it asks which one to build. To skip the build, choose Don’t build it.
Migrations
Kubana runs python manage.py migrate --noinput before your app starts. If a migration fails, the new version doesn’t start, the previous version keeps serving, and the deploy log shows the error. To manage migrations yourself, choose Turn off next to it.
Workers and schedulers
When your Django app uses a task queue, Configuration > How Kubana runs your app offers Add a worker. The worker uses the same repository, branch, size, settings module and a copy of the environment variables, and runs with the same Kubana settings as the web app. Kubana detects what it runs:
- Celery:
celery -A <your app> workerfor theCelery()app it finds, e.g. inconfig/celery_app.py. Beat runs too when you use django-celery-beat (with its database scheduler) or defineCELERY_BEAT_SCHEDULE. - Django Q (django-q2):
manage.py qcluster, which also runs your schedules. - Django RQ:
manage.py rqworkerwith the queues inRQ_QUEUES, plusrqschedulerwith rq-scheduler. - Huey (
huey.contrib.djhueyinINSTALLED_APPS):manage.py run_huey, which also runs periodic tasks and finishes the running task before it stops. - Dramatiq (django-dramatiq):
manage.py rundramatiq. - Django Tasks:
manage.py db_workerwith django-tasks-db, ormanage.py rqworker --job-class django_tasks_rq.Jobwith django-tasks-rq.
Set your broker and database URLs on the worker too. For scheduled manage.py commands, use cron jobs.
Secret key and other environment variables
When your settings read SECRET_KEY from an environment variable, for example os.environ["DJANGO_SECRET_KEY"] or env("DJANGO_SECRET_KEY"), and the app has no variable with that name, Kubana creates one with a random value. It is a normal variable you can see and change in Environment.
Set your database URL and other values in Environment. A DJANGO_SETTINGS_MODULE variable chooses which of your settings modules runs.
Warnings
Kubana warns, without blocking the deploy, when it sees:
DEBUG = Trueor thedjango-insecure-development key in the settings that run.- SQLite as the database: its file is lost on every redeploy.
MEDIA_ROOTwithout django-storages: uploaded files are lost on every redeploy. Store them in S3-compatible storage.
Custom start command
For what detection can’t handle, open Custom start command and enter the command that starts your app. It must listen on port 8080. Leave it empty to go back to what Kubana detects.
Last updated 19 October 2026 · Something missing or wrong? Tell us
