TemplateSyntaxError at /polls/
Invalid block tag on line 23: '</span><span'. Did you forget to register or load this tag?
{% 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 %}
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)
On May 29, 2016 4:23 PM, "Joseph Mitchell" <joemit...@gmail.com> wrote:
>
> 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:
>
Do you have a parent template that contains <span> tags? It's likely that you forgot an {% endblock%} or {% endif %} somewhere. It may also be in your current template of you didn't post the entire file.
-James