Answers for "views.py django"

3

views django

from django.http import HttpResponse
import datetime

def current_datetime(request):
    now = datetime.datetime.now()
    html = "<html><body>It is now %s.</body></html>" % now
    return HttpResponse(html)
Posted by: Guest on March-09-2021
0

views.py django

from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")
Posted by: Guest on August-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language