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