This code just looks like FB HTML. If you need more help, you need to better understand the structure of your Django Auth.
Here are a few more steps. I would consider Django-SocialAuth for an easily integrated experience if I were you.
Edit: Following on to turning on your Settings.py, assuming you read the Facebook Authentication documents as well as SocialAuth README, you will need to configure the appropriate controller for the fb authentication callback URL.
After that, connect these SocialAuth views to your current authentication process:
def facebook_login(request): """ Facebook login page """ if request.REQUEST.get("device"): device = request.REQUEST.get("device") else: device = "user-agent" params = {} params["client_id"] = FACEBOOK_APP_ID params["redirect_uri"] = request.build_absolute_uri(reverse("socialauth_facebook_login_done")) url = "https://graph.facebook.com/oauth/authorize?"+urllib.urlencode(params) return HttpResponseRedirect(url) def facebook_login_done(request): user = authenticate(request=request) if not user: request.COOKIES.pop(FACEBOOK_API_KEY + '_session_key', None) request.COOKIES.pop(FACEBOOK_API_KEY + '_user', None)
source share