Skip to content
impulseDOCS
Get Started

Build with Django

Create a project (quickstart), open the Connect tab, and copy your .env. Then wire it up:

Terminal window
pip install dj-database-url psycopg[binary]
settings.py
import dj_database_url, os
DATABASES = { "default": dj_database_url.parse(os.environ["DATABASE_URL"], conn_max_age=600) }
Terminal window
pip install django-storages boto3
STORAGES = { "default": { "BACKEND": "storages.backends.s3.S3Storage" } }
AWS_S3_ENDPOINT_URL = os.environ["S3_ENDPOINT"]
AWS_ACCESS_KEY_ID = os.environ["S3_ACCESS_KEY"]
AWS_SECRET_ACCESS_KEY = os.environ["S3_SECRET_KEY"]
AWS_STORAGE_BUCKET_NAME = "my-app-media"
AWS_S3_ADDRESSING_STYLE = "path"
Terminal window
pip install django-redis
CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": os.environ["REDIS_URL"] } }
SESSION_ENGINE = "django.contrib.sessions.backends.cache"

Keep Django auth for admin/server-rendered flows, or accept ImpulseAuth JWTs on your DRF API with PyJWT + your JWKS (details).

Gunicorn + Nginx on a Cloud VPS: a systemd unit for gunicorn, collectstatic to ImpulseDrive, TLS at the proxy.