from django.http  import HttpResponse
from django.template import Context,loader

from polls.models import Poll

def index(request):
    latest_poll_list = Poll.objects.order_by('-pub_date')[:5]
    template = loader.get_template('polls/index.html')
    context = Context({'latest_poll_list':latest_poll_list,})
    return HttpResponse(template.render(context))

