Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Facebook login taking me to 500 error page #32

Closed
fahdoo opened this Issue · 7 comments

3 participants

@fahdoo

I've installed django-socialregistration (v0.4) and the facebook-python-sdk dependency. Ran syncdb (so all the SR tables are there).

I see the Facebook Connect button and when I click on it, I see the FB popup to give permission to my site. However, after that, it goes to www.mysite.com/socialregistration/facebook/login with a 500 Internal Server Error. Ideally this should then redirect to the socialregistration's setup page to let me create a new user, correct?

Right now the socialregistration_facebook table is empty. The User table only has my admin account (which is not logged in).

The error log shows this:

[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]     new_obj = func(obj, *arg_vals), referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]   File "/home/$$$/webapps/django/lib/python2.6/django/template/defaultfilters.py", line 33, in _dec, referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]     args[0] = force_unicode(args[0]), referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]   File "/home/$$$/webapps/django/lib/python2.6/django/utils/encoding.py", line 66, in force_unicode, referer: http://$$$o.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]     s = unicode(s), referer: http://$$$o.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]   File "build/bdist.linux-i686/egg/socialregistration/models.py", line 13, in __unicode__, referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]     return u'%s: %s' % (self.user, self.uid), referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]   File "/home/$$$/webapps/django/lib/python2.6/django/db/models/fields/related.py", line 288, in __get__, referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1]     raise self.field.rel.to.DoesNotExist, referer: http://$$$.webfactional.com/
[Sat Jul 24 15:23:40 2010] [error] [client 127.0.0.1] TemplateSyntaxError: Caught DoesNotExist while rendering: , referer: http://$$$.webfactional.com/

Update:
So I tried hooking up Twitter as well. I'm basically getting the same error except now that I changed both Twitter and Facebook callback urls, they redirect to the /setup/ page - but still 500 error. Its possibly because I'm not sure if I need to hook up anything else. I'm assuming that the callback URL for Twitter should go to the .../twitter/callback/ and for Facebook it should be .../facebook/login/.

Update 2:
Found a temporary workaround - I tried SOCIALREGISTRATION_GENERATE_USERNAME = True and it works. Well, it redirects me to /accounts/profile (which doesn't exist - how do I customize this redirect?).

@fahdoo

Thanks - the redirect works.

Do you have any idea why the setup page is giving me a 500? Is there a way I can override it perhaps and create my own setup function instead - for example I'd love to be able to fetch a users facebook username, first and last name and populate that in the db on setup.

thanks!

@flashingpumpkin

The page throws a syntax error. Most probably there is something wrong in your template. Some moustaches missing or to an open block tag....
Other than that, you can just configure another view with the same url name as the setup view in your urls.py file.

@fahdoo

Hmm I don't think its a problem with any of my templates (after all they work fine otherwise). The problem seems to be on the def __unicode__ lines where it does return u'%s: %s' % (self.user, self.uid) for both Facebook and Twitter.

I have no idea why this all works if I bypass the setup with the autogenerated username.

@flashingpumpkin

It works because it's not rendering the themplate then.

@muhuk

See #45.

@flashingpumpkin

See #45

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.