forked from navinreddy20/Python-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
86 Django Template Language DTL.txt
49 lines (33 loc) · 1.54 KB
/
86 Django Template Language DTL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
view.py
--------------------------------------------------------------------------------
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def home(request):
return render(request, 'home.html', {'name': 'Kiran'})
--------------------------------------------------------------------------------
home.html
--------------------------------------------------------------------------------
<h1>Hello {{name}}!!!!!</h1>
--------------------------------------------------------------------------------
urls.py ::calc
--------------------------------------------------------------------------------
from django.urls import include, path
from . import views
from django.contrib import admin
urlpatterns = [
path('', views.home, name='home'),
]
--------------------------------------------------------------------------------
urls.py ::telusko
--------------------------------------------------------------------------------
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('calc.urls')),
path('admin/', admin.site.urls),
]
--------------------------------------------------------------------------------
settings.py
--------------------------------------------------------------------------------
'DIRS': [os.path.join(BASE_DIR, 'templates')],