From 0ec787126873b9a0577cb9af5354ee7c8d2dfb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Val=C3=A9rio?= Date: Fri, 22 Mar 2019 11:49:42 +0000 Subject: [PATCH] added a new environment to the settings --- Procfile | 2 +- app.json | 4 ++++ webhook_logger/settings.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 25b71ea..421bdf4 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: daphne -p $PORT webhook_logger.asgi:application +web: daphne -b 0.0.0.0 -p $PORT webhook_logger.asgi:application -v2 diff --git a/app.json b/app.json index 397a426..526b4e4 100644 --- a/app.json +++ b/app.json @@ -8,6 +8,10 @@ "SECRET_KEY": { "description": "Django Secret key settings", "generator": "secret" + }, + "APP_ENV": { + "description": "Environment the app runs in", + "value": "heroku" } } } diff --git a/webhook_logger/settings.py b/webhook_logger/settings.py index b3cd4ff..eca02cd 100644 --- a/webhook_logger/settings.py +++ b/webhook_logger/settings.py @@ -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")]