Skip to content

Commit

Permalink
Nitpicking
Browse files Browse the repository at this point in the history
  • Loading branch information
jgorset committed Apr 19, 2011
1 parent f801256 commit d2108ec
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions README.md
Expand Up @@ -6,28 +6,32 @@ and a walkthrough to replicate it.
## Walkthrough

First of all, we'll need to register a new application with the Facebook platform. To do so,
go to [facebook.com/developers](http://www.facebook.com/developers), click on the "set up new app"-button
and create your application. Once you have created your application, you'll be presented with a daunting
number of options. Don't worry, though; they're all optional and we don't need to configure any of them just yet.
go to [facebook.com/developers](http://www.facebook.com/developers) and create your application.
Once you have confirmed that you are in fact human, you'll be presented with a daunting number of
options. Don't worry, though; they're all optional and we only need to configure two of them right now.
Populate the "canvas page" field with the URL you'd like your application to be accessed from
(f.ex. 'http://apps.facebook.com/myapp') and the "canvas url" field with the URL that Facebook may
load your application from (f.ex. 'http://myserver.com/myapp'). You'll find both fields under
"Facebook integration".

Create a new Django project and install Fandjango:
Next, create a new Django project and install Fandjango:

$ django-admin.py startproject myfacebookapplication
$ pip install fandjango

Add fandjango to your list of installed applications, adjust your database settings and synchronize
Add fandjango to your list of installed applications, adjust your database settings and populate
it like you regularly would:

$ vim settings.py
$ ./manage.py syncdb

Fandjango needs some configuration. Specifically, you need to add its middleware to your middleware classes and specify
your application's id, secret key and url (all of which can be found on [facebook.com/developers](http://www.facebook.com/developers)
your application's id, secret key and canvas url (all of which can be found on [facebook.com/developers](http://www.facebook.com/developers))
in your settings file:

FACEBOOK_APPLICATION_ID = 118434614903049
FACEBOOK_SECRET_KEY = '8cce95c678d2cd3f51f11e7cce03cd21'
FACEBOOK_APPLICATION_URL = 'http://apps.facebook.com/myfacebookapplication'
FACEBOOK_APPLICATION_URL = 'http://apps.facebook.com/myapp'

MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
Expand All @@ -41,7 +45,7 @@ in your settings file:
*Note:* If you're using Django's built-in CSRF protection middleware, you need to make sure Fandjango's middleware precedes it.
Otherwise, Facebook's requests to your application will qualify cross-site request forgeries.

Next, define a view and route it:
Now define a view and route it:

# urls.py

Expand All @@ -57,9 +61,6 @@ Next, define a view and route it:
@facebook_authorization_required()
def home(request):
return HttpResponse('Hello, %s' % request.facebook.user.first_name)
Deploy your project, return to your application's settings at [facebook.com/developers](http://www.facebook.com/developers)
and specify the "canvas page" and "canvas url" settings under the "facebook integration" tab accordingly.

That's it! You have created a Facebook application that authorizes and greets its users. Navigate to the URL you specified
in the "canvas url" setting to have a closer look at your new marvel of technology.
That's it! You have created a Facebook application that authorizes and greets its users. Navigate to your application's canvas URL
to have a closer look at your new marvel of technology.

0 comments on commit d2108ec

Please sign in to comment.