I have provided a simple login functionality. For logout, I tried to use the built-in one. This is my urls.py:
(r'', include('django.contrib.auth.urls')),
And this is my template file:
{% if user.is_authenticated %}
logged in as {{ user }}
(<a href="{% url "logout" %}">logout</a>)
{% else %}
I have also enabled the default django admin site. When I click logout
, it shows me the administration logout view. How can I pass the logout next page attribute to tell django which view to render?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…