Here’s the error message populating my page, with the accompanying code issue:
TemplateSyntaxError at /home
Invalid block tag: ‘endblock’, expected ‘endif’
Request Method: GET
Request URL: http://localhost:8000/home
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value: Invalid block tag: ‘endblock’, expected ‘endif’
Code:
{% extends "profile/base_with_classes.html" %}
{% block username %}
{% if user == None %}
Nobody
{% else %}
{% if user.is_authenticated %}
{{ user.username }}
{% else %}
Unauthenticated User
{% endif %}
(% endif %}
{% endblock username %} <==== Issue is here
I don’t understand. This is at the top of the template.
In the last endif, you have
(instead of{