Skip to content

Commit 62b4f01

Browse files
committed
updates
1 parent 57da848 commit 62b4f01

File tree

11 files changed

+24
-3
lines changed

11 files changed

+24
-3
lines changed

Section 22 - Advanced Topics - CBVs/testadvcbv/db.sqlite3

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
{% block body %}
10+
{% endblock %}
11+
</body>
12+
</html>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{% extends "base.html" %}
2+
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
from django.shortcuts import render
2-
2+
from django.views.generic import View
3+
from django.http import HttpResponse
34
# Create your views here.
5+
6+
class CBView(View):
7+
def get(self, request):
8+
return HttpResponse('XYZ')

Section 22 - Advanced Topics - CBVs/testadvcbv/testadvcbv/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1616
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17-
17+
TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates')
1818

1919
# Quick-start development settings - unsuitable for production
2020
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
@@ -54,7 +54,7 @@
5454
TEMPLATES = [
5555
{
5656
'BACKEND': 'django.template.backends.django.DjangoTemplates',
57-
'DIRS': [],
57+
'DIRS': [TEMPLATES_DIR],
5858
'APP_DIRS': True,
5959
'OPTIONS': {
6060
'context_processors': [

Section 22 - Advanced Topics - CBVs/testadvcbv/testadvcbv/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"""
1616
from django.contrib import admin
1717
from django.urls import path
18+
from test_app import views
1819

1920
urlpatterns = [
2021
path('admin/', admin.site.urls),
22+
path('', views.CBView.as_view())
2123
]

0 commit comments

Comments
 (0)