Basically everything is written here. https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md
Since the package of python-social-auth has been subdivided since v0.3, it seems that it is necessary to add the package and change the setting.
The commented out part is the rewritten part.
settings.py
INSTALLED_APPS = [
# 'social.apps.django_app.default',
'social_django',
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
# 'social.apps.django_app.context_processors.backends',
# 'social.apps.django_app.context_processors.login_redirect',
'social_django.context_processors.backends',
'social_django.context_processors.login_redirect',
],
},
},
]
AUTHENTICATION_BACKENDS = [
# 'social.backends.twitter.TwitterOAuth',
'social_core.backends.twitter.TwitterOAuth',
'django.contrib.auth.backends.ModelBackend',
]
urls.py
urlpatterns = [
# url(r'^social/', include('social.apps.django_app.urls', namespace='social')),
url(r'^social/', include('social_django.urls', namespace='social')),
]
# python-social-Upgrade auth installs a lot of related packages
pip install -U python-social-auth
#Install additional packages for Django
pip install social-auth-app-django
# migrate
python manage.py migrate
Recommended Posts