I want to show the button if the user is superuser. I found some examples, but my code is not working. The button is not displayed. Does anyone know why?
views.py
def inici(request): zones = Zona.objects.all() return render_to_response('principal/inici.html', dict(zones=zones), context_instance = RequestContext(request))
inici.html
{% if not user.is_authenticated %} .... {% else %} <ul> <li class="nivell1"> <a href="/accounts/logout/?next=/">Logout</a> </li> <li class="nivell1"> <a class="nivell1" herf="#"> Configuració </a> </li> {% if request.user.is_superuser %} <li class="nivell1"> <a href="zona/crear/">Crear zona</a> </li> {% endif %} </ul> {% endif %}
I have only the user in the database and he is superuser. I see the "Exit" button and another, but not the "crear zona" button.
source share