If you’re developing a web application that allows uses to create an account, you’re probably allowing them to do so using Facebook. In order to provide this functionality, Facebook requires you to create an application on their developer portal and set a few basic parameters.
But rather than create one application for both local development and production, my preferred way is to create a second Facebook application specifically for dev. You’ll need to set a few parameters in the application’s config to get things working.
First in the Basic settings set the App Domains along with the Site URL:
Then in the Advanced set the OAuth redirect URIs:
Make sure to include the port you use in the various URLs / URIs. Django’s default is 8000.
And if you keep your application ID / secret as settings in your Django config and use Disqus-style settings, you can simply add the new values for your Facebook application to your dev config to override the default values.
Reblogged this on Sutoprise Avenue, A SutoCom Source.
Facebook apps no longer appear to accept localhost or 127.0.0.1 as valid originating urls, with or without a port specified. I haven’t been able to find a workaround yet. If you can, I’d love to hear of it!
The workaround is to locally map a domain name to 127.0.0.1.
To do this, edit your hosts file and add the domain:
127.0.0.1 local.mysite.com
Then add the domain (local.mysite.com) to your Facebook application settings.
Instructions for editing your hosts file can be found here – http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/.