views:

219

answers:

2

I'm developing a Django application. I need to authenticate users using Facebook and get the user's friends list to invite them to my site. To do this my application has to be registered with Facebook to get the API key. In the process of doing so I'm struck with the list of settings.

"http://localhost/login" --> this is the login page in my application where I have the Facebook-connect button

I need Facebook to redirect the response to "http://localhost/result", where I have a view to parse the result.

Please let me know how to configure Facebook.

+1  A: 

Facebook can't redirect the response to 'localhost', as that's obviously local to your machine, hence the name. Your app needs to be somewhere Facebook's servers can actually see it - ie on a public host somewhere.

In other words, you can't develop and test a Facebook app completely on your local machine, as you would with a normal Django app. You'll need to upload it to your host at regular intervals to see any changes.

Daniel Roseman
Port forwarding FTW.
Dustin Fineout
A: 

Alternately, you can set up port forwarding on your firewall/router to allow Facebook to retrieve directly from your localhost. The instructions for doing this vary greatly between different firewall/router manufacturers. What you need to do is open external port 80 and forward it to port 80 (or whatever port you have your HTTP server listening on) on the host machine where your app is, find your public IP address, and then use them as your callback address as follows:

http://<your.ip.here>:80/login

This will allow you to test your FB or FB-Connect app on localhost.

Dustin Fineout