Framework

Django

Django projects using the development server. Suitable for demos and internal tools.

Container port8000

Requirements

requirements.txt in the repo root with django

DropDeploy runs pip install -r requirements.txt.

manage.py in the repo root

DropDeploy identifies Django projects by manage.py and starts with it.

Demo app

A minimal app that is ready to push and deploy. Copy the files below into a new repository, commit, and deploy — it should go live without any changes.

Quickstart

pip install django && django-admin startproject myproject . && python manage.py startapp hello
requirements.txt
django>=4.2
myproject/settings.py
# Add to your existing settings.py:

import os

SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-only-secret-change-in-production')

DEBUG = os.environ.get('DEBUG', 'True') == 'True'

# Read allowed hosts from env var — include your DropDeploy subdomain
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost,127.0.0.1').split(',')

INSTALLED_APPS = [
    'django.contrib.staticfiles',
    'hello',
    # ... other apps
]

ROOT_URLCONF = 'myproject.urls'
myproject/urls.py
from django.urls import path
from hello import views

urlpatterns = [
    path('', views.index),
]
hello/views.py
from django.http import HttpResponse

def index(request):
    html = """
    <html>
      <body style="font-family:system-ui;display:flex;justify-content:center;
                   align-items:center;min-height:100vh;margin:0;
                   background:#0f172a;color:#f1f5f9">
        <div style="text-align:center">
          <h1 style="color:#16a34a">Hello from DropDeploy!</h1>
          <p style="color:#94a3b8">Django app is live.</p>
        </div>
      </body>
    </html>
    """
    return HttpResponse(html)
Run the quickstart command from your project root to scaffold the project, then add the files above.

Build & start commands

DropDeploy runs these steps inside the container when you click Deploy.

pip install -r requirements.txt
python manage.py runserver 0.0.0.0:8000

Environment variables

Set these in Project → Env Vars in the dashboard. Never commit secrets.

VariableRequiredDescription
SECRET_KEYYesDjango requires a secret key. Never commit it — add via dashboard.
DEBUGNoSet to False in production.
ALLOWED_HOSTSYesAdd your DropDeploy subdomain or Django returns 400 on every request.
DATABASE_URLNoUse dj-database-url to read this in settings.py.

Common issues

DisallowedHost — 400 on every request

Add your DropDeploy subdomain to ALLOWED_HOSTS, or read it from an env var as shown in the demo app.

Static files not loading

The dev server does not serve staticfiles/ in production. Set DEBUG=True for demos, or add WhiteNoise.