mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-06 21:20:32 +03:00
Clean up demo codebase
This commit is contained in:
parent
6ace9de268
commit
680bb56e99
|
@ -29,8 +29,10 @@ ALLOWED_HOSTS = []
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
"django.core.context_processors.request",
|
"django.core.context_processors.request",
|
||||||
"allauth.account.context_processors.account",
|
|
||||||
"allauth.socialaccount.context_processors.socialaccount",
|
# Disabling due to alluth>=0.21.0 changes
|
||||||
|
# "allauth.account.context_processors.account",
|
||||||
|
# "allauth.socialaccount.context_processors.socialaccount",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
@ -51,6 +53,8 @@ INSTALLED_APPS = (
|
||||||
'allauth',
|
'allauth',
|
||||||
'allauth.account',
|
'allauth.account',
|
||||||
'rest_auth.registration',
|
'rest_auth.registration',
|
||||||
|
'allauth.socialaccount',
|
||||||
|
'allauth.socialaccount.providers.facebook',
|
||||||
)
|
)
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = (
|
MIDDLEWARE_CLASSES = (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
django>=1.5.0
|
django>=1.7.0
|
||||||
django-rest-auth==0.5.0
|
django-rest-auth==0.5.0
|
||||||
django-allauth==0.19.1
|
django-allauth==0.24.1
|
||||||
six==1.9.0
|
six==1.9.0
|
||||||
|
|
|
@ -87,11 +87,9 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
'allauth.socialaccount.providers.facebook',
|
'allauth.socialaccount.providers.facebook',
|
||||||
)
|
)
|
||||||
|
|
||||||
2. Add ``allauth.socialaccount.context_processors.socialaccount`` to TEMPLATE_CONTEXT_PROCESSORS in django settings
|
2. Add Social Application in django admin panel
|
||||||
|
|
||||||
3. Add Social Application in django admin panel
|
3. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute:
|
||||||
|
|
||||||
4. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute:
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -101,7 +99,7 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
class FacebookLogin(SocialLoginView):
|
class FacebookLogin(SocialLoginView):
|
||||||
adapter_class = FacebookOAuth2Adapter
|
adapter_class = FacebookOAuth2Adapter
|
||||||
|
|
||||||
5. Create url for FacebookLogin view:
|
4. Create url for FacebookLogin view:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -109,3 +107,5 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
...,
|
...,
|
||||||
url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
|
url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.. note:: Starting from v0.21.0, django-allauth has dropped support for context processors. Check out http://django-allauth.readthedocs.org/en/latest/changelog.html#from-0-21-0 for more details.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user