aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/settings.py')
-rw-r--r--pysite/settings.py45
1 files changed, 37 insertions, 8 deletions
diff --git a/pysite/settings.py b/pysite/settings.py
index 6bcf9a53..ed732872 100644
--- a/pysite/settings.py
+++ b/pysite/settings.py
@@ -46,13 +46,16 @@ elif 'CI' in os.environ:
SECRET_KEY = "{©ø¬½.Þ7&Ñ`Q^Kº*~¢j<wxß¾±ðÛJ@q"
else:
- ALLOWED_HOSTS = [
- 'pythondiscord.com',
- 'admin.pythondiscord.com',
- 'api.pythondiscord.com',
- 'staff.pythondiscord.local',
- 'wiki.pythondiscord.local'
- ]
+ ALLOWED_HOSTS = env.list(
+ 'ALLOWED_HOSTS',
+ default=[
+ 'pythondiscord.com',
+ 'admin.pythondiscord.com',
+ 'api.pythondiscord.com',
+ 'staff.pythondiscord.local',
+ 'wiki.pythondiscord.local'
+ ]
+ )
SECRET_KEY = env('SECRET_KEY')
@@ -168,7 +171,7 @@ DEFAULT_HOST = 'home'
if DEBUG:
PARENT_HOST = 'pythondiscord.local:8000'
else:
- PARENT_HOST = 'pythondiscord.com'
+ PARENT_HOST = env('PARENT_HOST', default='pythondiscord.com')
# Django REST framework
# http://www.django-rest-framework.org
@@ -181,3 +184,29 @@ REST_FRAMEWORK = {
),
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
}
+
+# Logging
+# https://docs.djangoproject.com/en/2.1/topics/logging/
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'formatters': {
+ 'default': {
+ 'format': '%(asctime)s %(levelname)s %(module)s %(message)s'
+ }
+ },
+ 'handlers': {
+ 'gunicorn': {
+ 'level': 'INFO',
+ 'class': 'logging.StreamHandler',
+ 'formatter': 'default'
+ }
+ },
+ 'loggers': {
+ 'gunicorn.errors': {
+ 'level': 'DEBUG',
+ 'handlers': ['gunicorn'],
+ 'propagate': True
+ }
+ }
+}