Articles → DJANGO → Render Html Using Function-Based View In Django
Render Html Using Function-Based View In Django
Render HTML
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
def home(request):
html = \
"""
<html>
<head>
</head>
<body>
<h1>This is the first heading</h1>
</body>
</html>
"""
return HttpResponse(html)
Click to Enlarge