[Answer]-New to python/django and ran into a snag in Pycharm quickstart documentation

1👍

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.)

Leave a comment