added a new environment to the settings

This commit is contained in:
Gonçalo Valério 2019-03-22 11:49:42 +00:00
parent dce86535bd
commit 0ec7871268
3 changed files with 8 additions and 1 deletions

View File

@ -1 +1 @@
web: daphne -p $PORT webhook_logger.asgi:application
web: daphne -b 0.0.0.0 -p $PORT webhook_logger.asgi:application -v2

View File

@ -8,6 +8,10 @@
"SECRET_KEY": {
"description": "Django Secret key settings",
"generator": "secret"
},
"APP_ENV": {
"description": "Environment the app runs in",
"value": "heroku"
}
}
}

View File

@ -26,6 +26,9 @@ APP_ENV = os.environ.get("ENVIRONMENT", "development")
# SECURITY WARNING: don't run with debug turned on in production!
if APP_ENV == "development":
DEBUG = True
elif APP_ENV == "heroku":
DEBUG = False
ALLOWED_HOSTS = [".herokuapp.com"]
else:
DEBUG = False
ALLOWED_HOSTS = [os.environ.get("DOMAIN")]