mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-27 07:10:37 +03:00
update installation doc
This commit is contained in:
parent
41a0688b04
commit
9515eb4ff5
|
@ -61,6 +61,8 @@ Social Authenitcation (optional)
|
||||||
|
|
||||||
Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creating social media authentication view. Below is an example with Facebook authentication.
|
Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creating social media authentication view. Below is an example with Facebook authentication.
|
||||||
|
|
||||||
|
.. note:: Points 1, 2 and 3 are related with ``django-allauth`` configuration, so if you have already configured social authentication, then please go to step 4. See ``django-allauth`` documentation for more details.
|
||||||
|
|
||||||
1. Add ``allauth.socialaccount`` and ``allauth.socialaccount.providers.facebook`` apps to INSTALLED_APPS in your django settings.py:
|
1. Add ``allauth.socialaccount`` and ``allauth.socialaccount.providers.facebook`` apps to INSTALLED_APPS in your django settings.py:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
@ -79,7 +81,11 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
'allauth.socialaccount.providers.facebook',
|
'allauth.socialaccount.providers.facebook',
|
||||||
)
|
)
|
||||||
|
|
||||||
2. Create a view as a subclass of ``rest_auth.registration.views.SocialLogin``:
|
2. Add ``allauth.socialaccount.context_processors.socialaccount`` to TEMPLATE_CONTEXT_PROCESSORS in django settings
|
||||||
|
|
||||||
|
3. Add Social Application in django admin panel
|
||||||
|
|
||||||
|
4. Create new view as a subclass of ``rest_auth.registration.views.SocialLogin`` with ``FacebookOAuth2Adapter`` adapter as an attribute:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -89,7 +95,7 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
class FacebookLogin(SocialLogin):
|
class FacebookLogin(SocialLogin):
|
||||||
adapter_class = FacebookOAuth2Adapter
|
adapter_class = FacebookOAuth2Adapter
|
||||||
|
|
||||||
3. Create url for FacebookLogin view:
|
5. Create url for FacebookLogin view:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user