preping views

This commit is contained in:
Arnold Dechamps 2024-02-23 04:01:36 +01:00
parent 49c565a6b1
commit 4d76891d1b
No known key found for this signature in database
GPG key ID: AE66543374E41C89
4 changed files with 22 additions and 1 deletions

View file

@ -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': [

View file

@ -0,0 +1,3 @@
{% block content %}
Hello World
{% endblock content %}

View file

@ -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),
]

16
tldtest/views.py Normal file
View file

@ -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)
"""