diff options
-rw-r--r-- | home/urls.py | 6 | ||||
-rw-r--r-- | pysite/hosts.py | 2 | ||||
-rw-r--r-- | pysite/settings.py | 9 | ||||
-rw-r--r-- | pysite/urls.py | 6 |
4 files changed, 18 insertions, 5 deletions
diff --git a/home/urls.py b/home/urls.py index 077e7287..31e76c9f 100644 --- a/home/urls.py +++ b/home/urls.py @@ -1,5 +1,9 @@ from django.contrib import admin from django.urls import path +from django.views.generic import TemplateView -urlpatterns = [] +app_name = 'home' +urlpatterns = [ + path('', TemplateView.as_view(template_name='home/index.html')) +] 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")) +] |