Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- env = environ.Env(
- DEBUG=(bool, False),
- SECRET_KEY=(str, ''),
- DATABASE_URL=(str, 'postgres://testing:testing@localhost/testing'),
- )
- if os.path.exists(env_file):
- env.read_env(env_file)
- DEBUG = env.bool('DEBUG')
- SECRET_KEY = env.str('SECRET_KEY')
- if DEBUG and not SECRET_KEY:
- SECRET_KEY = 'xxx'
- # Default '@localhost' is needed for the production server. But that will probably fail
- # on development machine. Write "DEBUG=1" to ".env" file to enable.
- if DEBUG:
- DATABASE_URL = 'postgres://testing:testing@testing_postgres/testing'
- DATABASES = {'default': env.db()}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement