Django and Testing Facebook Applications Locally (Port 8000)

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.

3 thoughts on “Django and Testing Facebook Applications Locally (Port 8000)”

  1. Facebook apps no longer appear to accept localhost or 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!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s