Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Migrate from django social auth to python social auth
from django.contrib.sessions.models import Session
for s in Session.objects.iterator():
session_dict = s.get_decoded()
if '_auth_user_backend' in session_dict.keys():
#New backend is social.backends.facebook.FacebookOAuth2
#Change from old backend
if session_dict['_auth_user_backend'] == 'social_auth.backends.facebook.FacebookBackend':
session_dict['_auth_user_backend'] = 'social.backends.facebook.FacebookOAuth2'
new_s =, session_dict, s.expire_date)
Copy link

SalahAdDin commented Jul 5, 2014

Thak you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment