Created
December 17, 2017 13:51
-
-
Save solidpple/6aa287bd6a6c14af05a2a8b8dd61ca22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
from .models import Question | |
def index(request): | |
latest_question_list = Question.objects.order_by('-pub_date')[:5] | |
template = loader.get_template('polls/index.html') | |
context = { | |
'latest_question_list': latest_question_list, | |
} | |
return HttpResponse(template.render(context, request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment