Skip to content

Commit

Permalink
preping views
Browse files Browse the repository at this point in the history
  • Loading branch information
altf4arnold committed Feb 23, 2024
1 parent 49c565a commit 4d76891
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tldtest/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
"DIRS": [BASE_DIR / "templates"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down
3 changes: 3 additions & 0 deletions tldtest/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
Hello World
{% endblock content %}
2 changes: 2 additions & 0 deletions tldtest/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"""
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 changes: 16 additions & 0 deletions tldtest/views.py
Original file line number Diff line number Diff line change
@@ -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)
"""

0 comments on commit 4d76891

Please sign in to comment.