· 7 years ago · Sep 11, 2018, 02:42 PM
1#!/usr/bin/env python
2
3from django.core.management.utils import get_random_secret_key
4
5if __name__ == "__main__":
6 with open(".env", "w") as env_file:
7 env_file.write("""DEBUG=on
8SECRET_KEY={}
9ALLOWED_HOSTS=*
10DATABASE_URL=postgresql://django:django@localhost:5432/db
11""".format(get_random_secret_key()))