diff --git a/tldtest/settings.py b/tldtest/settings.py index 84ba062..13f8445 100644 --- a/tldtest/settings.py +++ b/tldtest/settings.py @@ -56,7 +56,7 @@ ROOT_URLCONF = 'tldtest.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + "DIRS": [BASE_DIR / "templates"], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/tldtest/templates/index.html b/tldtest/templates/index.html new file mode 100644 index 0000000..819c632 --- /dev/null +++ b/tldtest/templates/index.html @@ -0,0 +1,3 @@ +{% block content %} +Hello World +{% endblock content %} diff --git a/tldtest/urls.py b/tldtest/urls.py index ccd3d6c..59b728b 100644 --- a/tldtest/urls.py +++ b/tldtest/urls.py @@ -15,7 +15,9 @@ Including another URLconf """ from django.contrib import admin from django.urls import path +from .views import Index urlpatterns = [ + path("", Index.as_view(), name="home"), path('admin/', admin.site.urls), ] diff --git a/tldtest/views.py b/tldtest/views.py new file mode 100644 index 0000000..0415afc --- /dev/null +++ b/tldtest/views.py @@ -0,0 +1,16 @@ +from django.shortcuts import render +from django.views.generic import TemplateView + + +class Index(TemplateView): + template_name = 'index.html' + +""" +def handler404(request): + return render(request, '404.html', status=404) + + +def handler500(request): + return render(request, '500.html', status=500) + +""" \ No newline at end of file