update documentation

This commit is contained in:
Mateusz Sikora 2014-10-09 14:16:39 +02:00
parent cf19e58dc8
commit 478d10017c
5 changed files with 56 additions and 27 deletions

View File

@ -4,34 +4,35 @@ API endpoints
Basic
-----
- (POST) /rest-auth/login/
- /rest-auth/login/ (POST)
- username (string)
- password (string)
- (POST) /rest-auth/logout/
- /rest-auth/logout/ (POST)
- (POST) /rest-auth/password/reset/
- /rest-auth/password/reset/ (POST)
- email
- (POST) /rest-auth/password/reset/confim/
- /rest-auth/password/reset/confim/ (POST)
- uid
- token
- new_password1
- new_password2
- (POST) /rest-auth/password/change/
.. note:: uid and token are sent in email after calling /rest-auth/password/reset/
- /rest-auth/password/change/ (POST)
- new_password1
- new_password2
- (GET) /rest-auth/user/
- /rest-auth/user/ (GET)
- (PUT/PATCH) /rest-auth/user/
- /rest-auth/user/ (PUT/PATCH)
- username
- first_name
@ -41,3 +42,34 @@ Basic
Registration
------------
- /rest-auth/registration/ (POST)
- username
- password1
- password2
- email
.. note:: This endpoint is based on ``allauth.account.views.SignupView`` and uses the same form as in this view. To override fields you have to create custom Signup Form and define it in django settings:
.. code-block:: python
ACCOUNT_FORMS = {
'signup': 'path.to.custom.SignupForm'
}
See allauth documentation for more details.
- /rest-auth/registration/ (POST)
- key
Social Media Authentication
---------------------------
Basing on example from installation section :doc:`Installation </installation>`
- /rest-auth/facebook/ (POST)
- access_token

View File

@ -1,2 +1,16 @@
changelog
Changelog
=========
0.3.0
-----
- replaced ``django-registration`` with ``django-allauth``
- moved registration logic to separated django application (``rest_auth.registration``)
- added serializers customization in django settings
- added social media authentication view
- changed request method from GET to POST in logout endpoint
- changed request method from POST to PUT/PATCH for user details edition
- changed password reset confim url - uid and token should be sent in POST
- increase test coverage
- made compatibile with django 1.7
- removed user profile support

View File

@ -23,7 +23,6 @@ Possible key values:
Example configuration:
.. code-block:: python
:emphasize-lines: 3,5
REST_AUTH_SERIALIZERS = {
'LOGIN_SERIALIZER': 'path.to.custom.LoginSerializer',

View File

@ -17,12 +17,3 @@ Contents
API endpoints <api_endpoints>
Configuration <configuration>
Changelog <changelog>
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -4,7 +4,6 @@ Installation
1. Add ``rest_auth`` app to INSTALLED_APPS in your django settings.py:
.. code-block:: python
:emphasize-lines: 3,5
INSTALLED_APPS = (
...,
@ -20,7 +19,6 @@ Installation
2. Add rest_auth urls:
.. code-block:: python
:emphasize-lines: 3,5
urlpatterns = patterns('',
...,
@ -39,7 +37,6 @@ Registration (optional)
2. Add ``allauth``, ``allauth.account`` and ``rest_auth.registration`` apps to INSTALLED_APPS in your django settings.py:
.. code-block:: python
:emphasize-lines: 3,5
INSTALLED_APPS = (
...,
@ -51,7 +48,6 @@ Registration (optional)
3. Add rest_auth.registration urls:
.. code-block:: python
:emphasize-lines: 3,5
urlpatterns = patterns('',
...,
@ -68,7 +64,6 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
1. Add ``allauth.socialaccount`` and ``allauth.socialaccount.providers.facebook`` apps to INSTALLED_APPS in your django settings.py:
.. code-block:: python
:emphasize-lines: 3,5
INSTALLED_APPS = (
...,
@ -87,7 +82,6 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
2. Create a view as a subclass of ``rest_auth.registration.views.SocialLogin``:
.. code-block:: python
:emphasize-lines: 3,5
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from rest_auth.registration.views import SocialLogin
@ -98,9 +92,8 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
3. Create url for FacebookLogin view:
.. code-block:: python
:emphasize-lines: 3,5
urlpatterns += pattern('',
...,
url(r'^social-login/facebook/$', FacebookLogin.as_view(), name='fb_login')
url(r'^/rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
)