Migrating from python-social-auth to split social
The new organization split the monolithic structure into smaller packages with their responsibility well defined, and better dependencies handling.
python-social-auth cleaned up the code and added the needed imports to
the new libraries and defined a single dependency in the requirements.txt
social-auth-core, this aims to ease the transition to the new structure.
But that won't solve everybody situation, people using the different
frameworks also need to define their corresponding requirement, or use
one of the defined
extras in the
Django users need to add the
dependency. Those using
mongoengine, need to add
Several errors were reported due to migrations not applying properly
when migrating to the new app, most of them are caused because the app
switched names a few times, from
probably something else in between. That's the reason the migrations
replaces attribute, that way Django can identify already
applied migrations and not run them again.
In order to make complete the move to the new project setup, first
ensure to move to
python-social-auth==0.2.21, run the migrations at
that point, then continue with the move to the new project and run the
migrations again. Steps:
pip install "python-social-auth==0.2.21"
python manage.py migrate
Move to the new project
Run migrations again
python manage.py migrate
- Update your references to
social.*in your settings, most notably:
AUTHENTICATION_BACKENDSare now under
- Context processors are now under
MIDDLEWARE_CLASSESare now under
- If you have it overridden,
- Update your
- Update your urls patterns to include
$ pip install python-social-auth[django] $ pip install python-social-auth[django-mongoengine]
Flask users need to add
social-auth-app-flask, and depending on the
storage solution, add one of the following too:
social-auth-app-flask-sqlalchemywhen using SQLAlchemy
social-auth-app-flask-mongoenginewhen using Mongoengine
social-auth-app-flask-peeweewhen using Peewee
$ pip install python-social-auth[flask] $ pip install python-social-auth[flask-mongoengine] $ pip install python-social-auth[flask-peewee]
Pyramid users need to add
social-auth-app-pyramid to their dependencies.
$ pip install python-social-auth[pyramid]
Tornado users need to add
social-auth-app-tornado to their dependencies.
$ pip install python-social-auth[tornado]
Web.py users need to add
social-auth-app-webpy to their dependencies.
$ pip install python-social-auth[webpy]
Cherrypy users need to add
social-auth-app-cherrypy to their dependencies.
$ pip install python-social-auth[cherrypy]