Articles → DJANGO → Render our view from HTML template in django
Render our view from HTML template in django
Steps
Create a HTML template
<html>
<head>
</head>
<body>
<h1>This is the first heading</h1>
<h2>This is the second heading</h2>
</body>
</html>
Set the template path in settings.py
Click to Enlarge
Change in home function in TestModule.
def home(request):
return render(request, "FirstTemplate.html",{})
Output
Click to Enlarge