Deploy a Django app
With Drone (recommended)
Section titled “With Drone (recommended)”Push your code to GitHub, start a new app, pick the repository and click Deploy with Drone. Or run hivepod deploy in the project folder.
With the Django preset
Section titled “With the Django preset”Pick Django. DockHive installs requirements.txt and serves your project’s WSGI app with gunicorn. Include gunicorn in requirements.txt.
Settings to check
Section titled “Settings to check”ALLOWED_HOSTS must include your app’s address and any custom domains, or Django refuses requests:
import os
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",")CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS if h]DEBUG = os.environ.get("DEBUG") == "1"SECRET_KEY = os.environ["SECRET_KEY"]Then set these environment variables:
ALLOWED_HOSTS=wonder-web-8ml2.dockhive.app,www.example.comSECRET_KEY=a-long-random-stringDATABASE_URL=postgresql://...Static files: serve them with WhiteNoise and run collectstatic in your build command.
Migrations: run python manage.py migrate as part of your start command, for example:
python manage.py migrate && gunicorn myproject.wsgi --bind 0.0.0.0:$PORTIf the build says it can’t find wsgi.py, set the Start Command yourself as above.