Base Endpoints¶
User¶
Use this endpoint to retrieve/update user.
Default URL: /users/me/
Backward-compatible URL: /me/
Method | Request | Response |
---|---|---|
GET |
– |
|
PUT |
{{ User.REQUIRED_FIELDS }} |
|
User Create¶
Use this endpoint to register new user. Your user model manager should implement create_user method and have USERNAME_FIELD and REQUIRED_FIELDS fields.
Default URL: /users/
Backward-compatible URL: /users/create/
Note
re_password
is only required if USER_CREATE_PASSWORD_RETYPE
is True
Method | Request | Response |
---|---|---|
POST |
|
|
User Delete¶
Use this endpoint to delete authenticated user. By default it will simply verify
password provided in current_password
, delete the auth token if token
based authentication is used and invoke delete for a given User
instance.
One of ways to customize the delete behavior is to override User.delete
.
Default URL: /users/me/
Backward-compatible URL: /users/delete/
Method | Request | Response |
---|---|---|
DELETE |
|
|
User Activate¶
Use this endpoint to activate user account. This endpoint is not a URL which
will be directly exposed to your users - you should provide site in your
frontend application (configured by ACTIVATION_URL
) which will send POST
request to activate endpoint. HTTP_403_FORBIDDEN
will be raised if user is already
active when calling this endpoint (this will happen if you call it more than once).
Default URL: /users/confirm/
Backward-compatible URL: /users/activate/
User Resend Activation E-mail¶
Use this endpoint to re-send the activation e-mail. Note that no e-mail would
be sent if the user is already active or if they don’t have a usable password.
Also if the sending of activation e-mails is disabled in settings, this call
will result in HTTP_400_BAD_REQUEST
Default URL: /users/resend/
Method | Request | Response |
---|---|---|
POST |
|
HTTP_204_NO_CONTENT
HTTP_400_BAD_REQUEST |
Set Username¶
Use this endpoint to change user username (USERNAME_FIELD
).
Default URL: /users/change_username/
Backward-compatible URL: /{{ User.USERNAME_FIELD }}/
Note
re_new_{{ User.USERNAME_FIELD }}
is only required if SET_USERNAME_RETYPE
is True
Method | Request | Response |
---|---|---|
POST |
|
|
Set Password¶
Use this endpoint to change user password.
Default URL: /password/
Note
re_new_password
is only required if SET_PASSWORD_RETYPE
is True
Method | Request | Response |
---|---|---|
POST |
|
|
Reset Password¶
Use this endpoint to send email to user with password reset link. You have to
setup PASSWORD_RESET_CONFIRM_URL
.
Default URL: /password/reset/
Note
HTTP_204_NO_CONTENT
if PASSWORD_RESET_SHOW_EMAIL_NOT_FOUND
is False
Otherwise and if {{ User.EMAIL_FIELD }}
does not exist in database HTTP_400_BAD_REQUEST
Method | Request | Response |
---|---|---|
POST |
{{ User.EMAIL_FIELD }} |
|
Reset Password Confirmation¶
Use this endpoint to finish reset password process. This endpoint is not a URL
which will be directly exposed to your users - you should provide site in your
frontend application (configured by PASSWORD_RESET_CONFIRM_URL
) which
will send POST
request to reset password confirmation endpoint.
HTTP_400_BAD_REQUEST
will be raised if the user has logged in or changed password
since the token creation.
Default URL: /password/reset/confirm/
Note
re_new_password
is only required if PASSWORD_RESET_CONFIRM_RETYPE
is True