jgorset/fandjango — Issue #41: Using Fandjango for a Website application
Author: jeffhoye
Created: 2011-11-08 18:12:54+00:00
State: open

I did my best to search for the answer, so I apologize if this has already been answered.

I've used Fandjango to great success for an "App on Facebook" , but now I want to create a different "Website" app -- where I just use Facebook to log in to my website.

I attempted to do this by setting the FACEBOOK_APPLICATION_URL to 'http://mysite' which does the proper redirect, but now I get into the infinite loop as described in problems #32 and #33. -- The site keeps loading on:
http://mysite/eggs/?code=AQDNr...#_=_ where the code changes every time.

Is there a way to use Fandjango in this manner? Here's my current code:

#urls.py

url(r'^fandjango/', include('fandjango.urls')),
(r'^eggs/', eggs),

#views.py

@facebook_authorization_required()
def eggs(request, *args, **kwargs):
return HttpResponse('Hello, %s' % request.facebook.user.first_name)

I wonder if there is a slick way to write a decoration such that it calls facebook_authorization_required() if a code is not given, then just passes on to my site after that. Thoughts / suggestions on how to do this?

Perhaps fandjango doesn't properly work with django's cookie authentication system and I should just use another solution. Suggestions?

Thanks!
-Jeff