2014-10-09 15:01:47 +04:00
API endpoints
=============
Basic
-----
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/login/ (POST)
2014-10-09 15:01:47 +04:00
2016-12-08 03:12:01 +03:00
- username
- email
- password
2014-10-09 15:01:47 +04:00
2016-12-22 22:57:23 +03:00
Returns Token key
2014-10-09 15:01:47 +04:00
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/logout/ (POST)
2016-02-09 01:35:37 +03:00
2016-12-01 06:38:03 +03:00
.. note :: `` ACCOUNT_LOGOUT_ON_GET = True `` to allow logout using GET - this is the exact same configuration from allauth. NOT recommended, see: http://django-allauth.readthedocs.io/en/latest/views.html#logout
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/password/reset/ (POST)
2014-10-09 15:01:47 +04:00
- email
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/password/reset/confirm/ (POST)
2014-10-09 15:01:47 +04:00
- uid
- token
- new_password1
- new_password2
2020-03-01 03:10:25 +03:00
.. note :: uid and token are sent in email after calling /dj-rest-auth/password/reset/
2014-10-09 16:16:39 +04:00
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/password/change/ (POST)
2014-10-09 15:01:47 +04:00
- new_password1
- new_password2
2015-05-22 22:47:06 +03:00
- old_password
2015-10-18 07:20:50 +03:00
2020-04-02 02:41:23 +03:00
.. note :: `` OLD_PASSWORD_FIELD_ENABLED = True `` to use old_password.
2015-10-18 07:20:50 +03:00
.. note :: `` LOGOUT_ON_PASSWORD_CHANGE = False `` to keep the user logged in after password change
2014-10-09 15:01:47 +04:00
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/user/ (GET, PUT, PATCH)
2014-10-09 15:01:47 +04:00
- username
- first_name
- last_name
2016-12-08 03:12:01 +03:00
Returns pk, username, email, first_name, last_name
2014-10-09 15:01:47 +04:00
Registration
------------
2014-10-09 16:16:39 +04:00
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/registration/ (POST)
2014-10-09 16:16:39 +04:00
- username
- password1
- password2
- email
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/registration/verify-email/ (POST)
2014-10-09 16:16:39 +04:00
- key
2020-03-30 19:32:12 +03:00
.. note :: If you set account email verification as mandatory, you have to add the VerifyEmailView with the used `name` .
2020-03-31 05:27:14 +03:00
You need to import the view: `` from dj_rest_auth.registration.views import VerifyEmailView `` . Then add the url with the corresponding name:
`` url(r'^dj-rest-auth/account-confirm-email/', VerifyEmailView.as_view(), name='account_email_verification_sent') `` to the urlpatterns list.
2020-03-30 19:32:12 +03:00
2014-10-09 16:16:39 +04:00
Social Media Authentication
---------------------------
Basing on example from installation section :doc: `Installation </installation>`
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/facebook/ (POST)
2014-10-09 16:16:39 +04:00
- access_token
2015-08-07 13:26:57 +03:00
- code
2016-02-23 14:48:30 +03:00
2020-03-02 01:42:28 +03:00
.. note :: `` access_token `` OR `` code `` can be used as standalone arguments, see https://github.com/jazzband/dj-rest-auth/blob/master/dj_rest_auth/registration/views.py
2016-10-25 00:23:44 +03:00
2020-03-01 03:10:25 +03:00
- /dj-rest-auth/twitter/ (POST)
2016-02-23 14:48:30 +03:00
- access_token
- token_secret