On Fri, Aug 12, 2011 at 10:04 PM, Harrison <harrison.mor...@gmail.com>wrote:

> I'm going through the tutorial, about views right now. I have this
> code:
>
> def index(request):
>    latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
>    t = loader.get_template('polls/index.html')
>    c = Context({
>        'latest_poll_list': latest_poll_list
>    })
>    HttpResponse(t.render(c))
>
> But it's saying that it didn't return an HttpResponse object when I go
> to the page. I tried everything I could think of, but it won't work.
> Am I doing something wrong?
>

The last line needs to be:

   return HttpResponse(t.render(c))

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to