aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/settings.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-01-01 21:15:29 +0100
committerGravatar Johannes Christ <[email protected]>2019-01-01 21:15:29 +0100
commita6e81b6757b43c68ee749006086035c3e8033f15 (patch)
treeb9fbfe6a0daac1884c83ad60476cc34a7b5d7971 /pysite/settings.py
parentapply stash (diff)
parentMerge pull request #156 from python-discord/django-beautify (diff)
Merge branch 'django' into django+add-role-viewset
Diffstat (limited to 'pysite/settings.py')
-rw-r--r--pysite/settings.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/pysite/settings.py b/pysite/settings.py
index 5badde5c..0175fb46 100644
--- a/pysite/settings.py
+++ b/pysite/settings.py
@@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
-# import sys
+import sys
import environ
@@ -73,6 +73,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'django_hosts',
+ 'django_filters',
'rest_framework',
'rest_framework.authtoken'
]
@@ -207,7 +208,22 @@ LOGGING = {
'django': {
'handlers': ['console'],
'propagate': True,
- 'level': 'INFO' if DEBUG else env('LOG_LEVEL', default='WARN')
+ 'level': env(
+ 'LOG_LEVEL',
+ default=(
+ # If there is no explicit `LOG_LEVEL` set,
+ # use `DEBUG` if we're running in debug mode but not
+ # testing. Use `ERROR` if we're running tests, else
+ # default to using `WARN`.
+ 'DEBUG'
+ if DEBUG and 'test' not in sys.argv
+ else (
+ 'ERROR'
+ if 'test' in sys.argv
+ else 'WARN'
+ )
+ )
+ )
}
}
}