Search code examples
djangotwitterdjango-socialauth

TypeError at /auth/login/twitter/


I've been trying to add log ins with social networks to one of my django projects. It works fine with Facebook but Twitter is broken.

I keep getting a the following error when I try to auth with Twitter.

TypeError at /auth/login/twitter/
sequence item 0: expected str instance, bytes found
Request Method: GET
Request URL:    http://127.0.0.1:8000/auth/login/twitter/
Django Version: 1.6.5
Exception Type: TypeError
Exception Value:    
sequence item 0: expected str instance, bytes found
Exception Location: C:\Users\cdegen\face\lib\site-packages\social_auth\backends\__init__.py in fetch_response, line 708
Python Executable:  C:\Users\cdegen\face\Scripts\python.exe
Python Version: 3.4.1
Python Path:    
['C:/Dev/django/face',
 'C:\\Program Files (x86)\\JetBrains\\PyCharm 3.4.1\\helpers\\pydev',
 'C:\\Dev\\django\\face',
 'C:\\Python34',
 'C:\\Windows\\system32\\python34.zip',
 'C:\\Python34\\DLLs',
 'C:\\Python34\\lib',
 'C:\\Users\\cdegen\\face',
 'C:\\Users\\cdegen\\face\\lib\\site-packages']
Server time:    Mon, 23 Jun 2014 08:33:39 -0400

I have the Twitter backends added to my AUTHENTICATION_BACKENDS. I have the TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET set.


Solution

  • I found the solution. I was using the django-social-auth3 which is the python3 fork of django-social-auth. I set up a new virtualevn using django-social-auth and I was able to auth with facebook, twitter and google+.