Question

I made it without incident to the "creating Views" section and the part where you get to setup you HTML template where you show a section only if you have polls:

enter image description here

I don't see poll_list show up in my dropdown options. I can't figure out why, any ideas?

Screen: enter image description here

Was it helpful?

Solution

There seems to be a bit missing in that tutorial: where they actually fill in the view that renders that template with the variables. Since you never send the variable to the template, it can't autocomplete it for you.

The view should be something like this:

def index(request):
    polls = Poll.objects.all()
    return render_to_response('index.html', {'poll_list': polls})

(Also, note that the {% url %} stuff a bit further down in that tutorial won't work with Django 1.6+, as you need to put the URL names in quotes.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top