Articles → DJANGO → Render Our View From HTML Template In Django
Render Our View From HTML Template In Django
Steps
- Create a HTML template.
- Set the template path in settings.py
- Change in home function in TestModule.
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