How can I get {% url logout %} to work in my Django template?
Add a logout url like this:
url(r"^logout/$", "django.contrib.auth.views.logout_then_login",
name="logout"),
The correct template syntax is:
{% url 'logout' %}
You didn't include django.contrib.auth
's URLs in your urls.py
, so there is no logout URL.
Try adding something like
url(r'^auth/', include('django.contrib.auth.urls')),