Last active
July 8, 2018 17:26
-
-
Save harijay/8e0817bb88a0f299c0b1cd9093fb9c7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from django.template import loader | |
def index(request): | |
#Get Last five Polls | |
latest_questions = Question.objects.order_by('-pub_date')[:5] | |
template = loader.get_template("polls/index.html") | |
context = { | |
'latest_questions':latest_questions, | |
} | |
return HttpResponse(template.render(context,request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment