diff options
Diffstat (limited to '')
| -rw-r--r-- | pysite/hosts.py | 4 | ||||
| -rw-r--r-- | pysite/settings.py | 45 | ||||
| -rw-r--r-- | pysite/urls.py | 6 | 
3 files changed, 42 insertions, 13 deletions
diff --git a/pysite/hosts.py b/pysite/hosts.py index 67fc2451..3cf41e7f 100644 --- a/pysite/hosts.py +++ b/pysite/hosts.py @@ -4,8 +4,8 @@ from django_hosts import host, patterns  host_patterns = patterns(      '',      # > | Subdomain | URL Module   | Host entry name | -    # host(r"admin",    "admin",  name="admin"), -    host(r'api',      'api.urls',    name='api'), +    host(r'admin', 'admin.urls',  name="admin"), +    host(r'api',   'api.urls',    name='api'),      # host(r"staff",    "staff",  name="staff"),      # host(r"wiki",     "wiki",   name="wiki"),      # host(r"ws",       "ws",     name="ws"), 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 +        } +    } +} diff --git a/pysite/urls.py b/pysite/urls.py index 3e2e05e8..e162a092 100644 --- a/pysite/urls.py +++ b/pysite/urls.py @@ -1,6 +1,6 @@  from django.urls import include, path -urlpatterns = [ -    path('', include('home.urls', namespace='home')) -] +urlpatterns = ( +    path('', include('home.urls', namespace='home')), +)  |