Sunday, May 29, 2016

TemplateSyntax Error - Invalid block tag '</span><span'.

Hi,   newbie here.  While going through https://docs.djangoproject.com/en/1.9/intro/tutorial03/ and I get the following:

TemplateSyntaxError at /polls/
Invalid block tag on line 23: '</span><span'. Did you forget to register or load this tag?

My templates/polls/index.html file has:

{% if latest_question_list %}

    <ul>

    {% for question in latest_question_list %}

        <li><a href="/polls/{{ question.id }}/">{{ question.question_text }}</a></li>

    {% endfor %}

    </ul>

{% else %}

    <p>No polls are available.</p>

{% endif %}


And my views.py has:

from django.http import HttpResponse

from django.shortcuts import render


from .models import Question



def index(request):

    latest_question_list = Question.objects.order_by('-pub_date')[:5]

    context = {'latest_question_list': latest_question_list}

    return render(request, 'polls/index.html', context)


def detail(request, question_id):

    return HttpResponse("You're looking at question %s." % question_id)


def results(request, question_id):

    response = "You're looking at the results of question %s."

    return HttpResponse(response % question_id)


def vote(request, question_id):

    return HttpResponse("You're voting on question %s." % question_id)


I've searched this group as well as google.  No luck.

Any suggestions?  Thanks in advance, most appreciated! 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c6c3ec4b-d502-4e02-8179-36ad503c39e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment