Skip to content

Commit b602d3e

Browse files
committed
add settings for prod env
1 parent 19afb47 commit b602d3e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

intbot/intbot/settings.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,53 @@
198198
}
199199

200200

201+
elif DJANGO_ENV == "prod":
202+
DEBUG = False
203+
SECRET_KEY = os.environ["SECRET_KEY"]
204+
205+
ALLOWED_HOSTS = [
206+
"127.0.0.1",
207+
"localhost",
208+
"internal.europython.eu",
209+
]
210+
211+
DATABASES = {
212+
"default": {
213+
"ENGINE": "django.db.backends.postgresql",
214+
"NAME": os.environ["POSTGRES_DB"],
215+
"USER": os.environ["POSTGRES_USER"],
216+
"PASSWORD": os.environ["POSTGRES_PASSWORD"],
217+
"HOST": "db",
218+
"PORT": "5432", # internal port
219+
}
220+
}
221+
222+
# For 500 errors to appear on stderr
223+
# For now it's good for docker, in the future sentry/or rollabar should be
224+
# here
225+
LOGGING = {
226+
"version": 1,
227+
"disable_existing_loggers": False,
228+
"handlers": {
229+
"console": {
230+
"class": "logging.StreamHandler",
231+
"stream": "ext://sys.stderr",
232+
},
233+
},
234+
"loggers": {
235+
"django": {
236+
"handlers": ["console"],
237+
"level": "WARNING",
238+
"propagate": True,
239+
},
240+
},
241+
}
242+
243+
DISCORD_BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
244+
245+
CSRF_TRUSTED_ORIGINS = [
246+
"https://internal.europython.eu",
247+
]
201248

202249

203250
elif DJANGO_ENV == "build":

0 commit comments

Comments
 (0)