Update documentation accordingly
This commit is contained in:
parent
44e26bb8de
commit
9e679fe532
1 changed files with 5 additions and 2 deletions
|
@ -90,6 +90,9 @@ login and logout views of other applications. They redirect to their similar
|
||||||
``next`` is given along the initial request, user is redirected to this url on
|
``next`` is given along the initial request, user is redirected to this url on
|
||||||
successful login and logout.
|
successful login and logout.
|
||||||
|
|
||||||
|
If you need to do this for the admin site, you shoud use
|
||||||
|
``capture_login_admin`` instead, performing checks to avoid redirection loops.
|
||||||
|
|
||||||
This requires to add urls before the include of the app' urls.
|
This requires to add urls before the include of the app' urls.
|
||||||
|
|
||||||
For example, to replace the Django admin login and logout views with allauth's
|
For example, to replace the Django admin login and logout views with allauth's
|
||||||
|
@ -97,13 +100,13 @@ ones:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from allauth_ens.views import capture_login, capture_logout
|
from allauth_ens.views import capture_login_admin, capture_logout
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# …
|
# …
|
||||||
|
|
||||||
# Add it before include of admin urls.
|
# Add it before include of admin urls.
|
||||||
url(r'^admin/login/$', capture_login),
|
url(r'^admin/login/$', capture_login_admin),
|
||||||
url(r'^admin/logout/$', capture_logout),
|
url(r'^admin/logout/$', capture_logout),
|
||||||
|
|
||||||
url(r'^admin/$', include(admin.site.urls)),
|
url(r'^admin/$', include(admin.site.urls)),
|
||||||
|
|
Loading…
Reference in a new issue