diff --git a/docs/api_endpoints.rst b/docs/api_endpoints.rst index 49d5d93..8ad7001 100644 --- a/docs/api_endpoints.rst +++ b/docs/api_endpoints.rst @@ -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 ` + +- /rest-auth/facebook/ (POST) + + - access_token diff --git a/docs/changelog.rst b/docs/changelog.rst index 763e482..f54eb25 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/docs/configuration.rst b/docs/configuration.rst index 83d0d2c..9018549 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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', diff --git a/docs/index.rst b/docs/index.rst index 031ce85..d6622db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,12 +17,3 @@ Contents API endpoints Configuration Changelog - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/docs/installation.rst b/docs/installation.rst index 5b17e41..5d092d1 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -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') )