43👍
✅
The django.contrib.admin
app also has a registration/logged_out.html
template.
To ensure that the template from your ‘account’ app, is used, make sure it is above ‘django.contrib.admin’ in your INSTALLED_APPS
setting.
INSTALLED_APPS = (
'account',
...
'django.contrib.admin',
...
)
The app template loader goes through the apps in INSTALLED_APPS
, and each app’s template directory until it finds a match. Therefore, if admin is above your app, then Django will use the template from the admin instead of from your app.
1👍
You can set to redirect it to a next page like this:
url(r'^accounts/logout/$',auth_views.logout, name='logout',
{'next_page': '/path_to_your_page/'})
According to: https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.views.logout
Or
<a href="{% url 'logout' %}?next=/path_to_the_page"> Logout</a>
- [Django]-How do you dynamically hide form fields in Django?
- [Django]-Function decorators with parameters on a class based view in Django
- [Django]-Querying django migrations table
Source:stackexchange.com