| 1 |
Views |
| 2 |
===== |
| 3 |
|
| 4 |
Login |
| 5 |
----- |
| 6 |
|
| 7 |
*URL name*: |
| 8 |
``account_login`` |
| 9 |
|
| 10 |
Users login via the ``allauth.account.views.LoginView`` view over at |
| 11 |
``/accounts/login/`` (URL name ``account_login``). When users attempt to login |
| 12 |
while their account is inactive (``user.is_active``) they are presented with the |
| 13 |
``account/account_inactive.html`` template. |
| 14 |
|
| 15 |
|
| 16 |
Signup |
| 17 |
------ |
| 18 |
|
| 19 |
*URL name*: |
| 20 |
``account_signup`` |
| 21 |
|
| 22 |
Users sign up via the ``allauth.account.views.SignupView`` view over at |
| 23 |
``/accounts/signup/`` (URL name ``account_signup``). |
| 24 |
|
| 25 |
|
| 26 |
Logout |
| 27 |
------ |
| 28 |
|
| 29 |
*URL name*: |
| 30 |
``account_logout`` |
| 31 |
|
| 32 |
The logout view (``allauth.account.views.LogoutView``) over at |
| 33 |
``/accounts/logout/`` (URL name ``account_logout``) requests for confirmation |
| 34 |
before logging out. The user is logged out only when the confirmation is |
| 35 |
received by means of a POST request. |
| 36 |
|
| 37 |
If you are wondering why, consider what happens when a malicious user |
| 38 |
embeds the following image in a post:: |
| 39 |
|
| 40 |
<img src="http://example.com/accounts/logout/"> |
| 41 |
|
| 42 |
For this and more background information on the subject, see: |
| 43 |
|
| 44 |
- https://code.djangoproject.com/ticket/15619 |
| 45 |
- http://stackoverflow.com/questions/3521290/logout-get-or-post |
| 46 |
|
| 47 |
If you insist on having logout on GET, then please consider adding a |
| 48 |
bit of Javascript to automatically turn a click on a logout link into |
| 49 |
a POST. As a last resort, you can set ``ACCOUNT_LOGOUT_ON_GET`` to |
| 50 |
``True``. |
| 51 |
|
| 52 |
|
| 53 |
Password Management |
| 54 |
------------------- |
| 55 |
|
| 56 |
Authenticated users can manage their password account using the |
| 57 |
``allauth.account.views.PasswordSetView`` and |
| 58 |
``allauth.account.views.PasswordChangeView`` views, over at |
| 59 |
``/accounts/password/set/`` respectively ``/accounts/password/change/`` (URL names |
| 60 |
``account_set_password`` and ``account_change_password`` respectively). |
| 61 |
|
| 62 |
Users are redirected between these views, according to whether or not |
| 63 |
they have setup a password (``user.has_usable_password()``). Typically, |
| 64 |
when users signup via a social provider they will not have a password |
| 65 |
set. |
| 66 |
|
| 67 |
|
| 68 |
Password Reset |
| 69 |
-------------- |
| 70 |
|
| 71 |
*URL name*: |
| 72 |
``account_reset_password`` |
| 73 |
|
| 74 |
Users can request a password reset using the |
| 75 |
``allauth.account.views.PasswordResetView`` view over at |
| 76 |
``/accounts/password/reset/`` (URL name ``account_reset_password``). An email |
| 77 |
will be sent containing a reset link pointing to ``PasswordResetFromKeyView`` |
| 78 |
view. |
| 79 |
|
| 80 |
|
| 81 |
Emails Management |
| 82 |
----------------- |
| 83 |
|
| 84 |
*URL name*: |
| 85 |
``account_email`` |
| 86 |
|
| 87 |
Users manage the email addresses tied to their account using the |
| 88 |
``allauth.account.views.EmailView`` view over at ``/accounts/email/`` (URL name |
| 89 |
``account_email``). Here, users can add (and verify) email addresses, remove |
| 90 |
email addresses, and choose a new primary email address. |
| 91 |
|
| 92 |
|
| 93 |
Email Verification |
| 94 |
------------------- |
| 95 |
|
| 96 |
Depending on the setting ``ACCOUNT_EMAIL_VERIFICATION``, a verification |
| 97 |
email is sent pointing to the |
| 98 |
``allauth.account.views.ConfirmEmailView`` view. |
| 99 |
|
| 100 |
The setting ``ACCOUNT_CONFIRM_EMAIL_ON_GET`` determines whether users |
| 101 |
have to manually confirm the address by submitting a confirmation form, |
| 102 |
or whether the address is automatically confirmed by a mere GET |
| 103 |
request. |