0

Django seems to come with a prebuilt login view implementation:

   url(r'^accounts/login/$', 'django.contrib.auth.views.login'),

which populates a template, by default located at registration/login.html.

Is there a symmetric implementation of logout? Can I write something like

   url(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),

and implement a template at registration/logout.html?

4

1 回答 1

1

是的,确实如此 - 请参阅文档以了解它可能采用的参数以及它提供给模板的上下文:

https://docs.djangoproject.com/en/1.5/topics/auth/default/#django.contrib.auth.views.logout

于 2013-09-13T00:43:33.377 回答