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


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, June 09, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250