Django .env Generator

Generate a Django .env with a strong random SECRET_KEY, DEBUG, ALLOWED_HOSTS and DATABASE_URL.

🔒 100% client-side. Your keys, secrets and values are never sent to any server and never stored.

.env

.env.example (secrets removed)

Input

Output

Paste your .env content

Django settings from .env

Load variables with python-dotenv or django-environ and read them in settings.py, e.g. SECRET_KEY = os.environ["SECRET_KEY"].

Production checklist

Set DEBUG=False, list your real domains in ALLOWED_HOSTS and use a unique SECRET_KEY per environment. Never commit it.

Frequently asked questions

How long should a Django SECRET_KEY be?

At least 50 characters is recommended. The alphanumeric option generates 40, so choose Hex (64) from Secret type for a longer key.

Does it work with django-environ?

Yes, the DATABASE_URL format is compatible.