preping views
This commit is contained in:
parent
49c565a6b1
commit
4d76891d1b
|
@ -56,7 +56,7 @@ ROOT_URLCONF = 'tldtest.urls'
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [],
|
"DIRS": [BASE_DIR / "templates"],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
|
|
3
tldtest/templates/index.html
Normal file
3
tldtest/templates/index.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{% block content %}
|
||||||
|
Hello World
|
||||||
|
{% endblock content %}
|
|
@ -15,7 +15,9 @@ Including another URLconf
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from .views import Index
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path("", Index.as_view(), name="home"),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
]
|
]
|
||||||
|
|
16
tldtest/views.py
Normal file
16
tldtest/views.py
Normal 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)
|
||||||
|
|
||||||
|
"""
|
Loading…
Reference in a new issue