From e740bccbee40ef136da80b52a2688c1e72528f8f Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Mon, 13 Aug 2018 22:45:44 +0200 Subject: Add regular URLconf. --- pysite/hosts.py | 2 +- pysite/settings.py | 9 ++++++--- pysite/urls.py | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 pysite/urls.py (limited to 'pysite') diff --git a/pysite/hosts.py b/pysite/hosts.py index 03fb610b..28633be5 100644 --- a/pysite/hosts.py +++ b/pysite/hosts.py @@ -2,7 +2,7 @@ from django.conf import settings 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", name="api"), diff --git a/pysite/settings.py b/pysite/settings.py index 6ca2fa48..5d770ca7 100644 --- a/pysite/settings.py +++ b/pysite/settings.py @@ -31,16 +31,18 @@ DEBUG = env('DEBUG') # SECURITY WARNING: keep the secret key used in production secret! if DEBUG: + ALLOWED_HOSTS = ['pythondiscord.local'] SECRET_KEY = "+_x00w3e94##2-qm-v(5&-x_@*l3t9zlir1etu+7$@4%!it2##" else: + ALLOWED_HOSTS = ['pythondiscord.com'] SECRET_KEY = env('SECRET_KEY') -ALLOWED_HOSTS = ['pythondiscord.com'] - # Application definition INSTALLED_APPS = [ + "home", + "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", @@ -64,7 +66,7 @@ MIDDLEWARE = [ "django_hosts.middleware.HostsResponseMiddleware", ] -ROOT_URLCONF = 'pysite.urls.main' +ROOT_URLCONF = 'pysite.urls' TEMPLATES = [ { @@ -134,6 +136,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/' +STATICFILES_DIRS = [os.path.join(BASE_DIR, 'pysite', 'static')] # django-hosts # https://django-hosts.readthedocs.io/en/latest/ diff --git a/pysite/urls.py b/pysite/urls.py new file mode 100644 index 00000000..0755f2ad --- /dev/null +++ b/pysite/urls.py @@ -0,0 +1,6 @@ +from django.urls import include, path + + +urlpatterns = [ + path("", include("home.urls", namespace="home")) +] -- cgit v1.2.3