Last active
July 12, 2018 18:42
-
-
Save alialavia/da1c82a9f5194257d1de868decec933c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import environ | |
import os | |
root = environ.Path(__file__) - 2 # two folders back (/a/b/ - 2 = /) | |
env = environ.Env(DEBUG=(bool, False),) # set default values and casting | |
GOOGLE_ANALYTICS_ID=env('GOOGLE_ANALYTICS_ID') | |
SITE_DOMAIN = env('SITE_DOMAIN') | |
SITE_ROOT = root() | |
DEBUG = env('DEBUG') # False if not in os.environ | |
DATABASES = { | |
'default': env.db(), # Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ | |
} | |
public_root = root.path('./public/') | |
MEDIA_ROOT = public_root('media') | |
MEDIA_URL = '/media/' | |
STATIC_ROOT = public_root('static') | |
STATIC_URL = '/static/' | |
AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID') | |
AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY') | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment