I've just developed a website with Django, which uses a database. Now I would like to implement my application as a Facebook App, usable in Facebook Canvas.
I'm totally a newbie in this area. I've searched all day, but I've not found any good docs or tutorial for an example. Is it so difficult? Can you give me some hints for beginning?
I don't want to rewrite al开发者_JAVA百科l my application in PHP, I still want to use my loved Django.
At the moment Facebook only requires you to work under an Iframe; so you have to show "normal" html content, with no extra stuff. Before you could use FBML -a weird facebook markup language- OR Iframe. Now only iframe. So actually any HTML & CSS page you create -with any javascript- will work.
For Opengraph, the FB API, the best I found is https://github.com/jgorset/fandjango
I had to do a couple of fixes to make it work with my code, but it's 95% great for login, data retrieval, posting, etc.
https://github.com/jgorset/fandjango-example is a sample app created by the same developer.
Well that's really easy, have a look at https://github.com/tschellenbach/Django-facebook
It is somewhat lacking on examples, but works like a charm.
Take a look here http://developers.facebook.com/docs/guides/canvas/
Basically, all a Facebook Canvas is an iframe. And a Facebook App is just a regular ole web app loaded in an iframe.
The biggest restriction to note is:
A Canvas Page is limited to a maximum of 760 pixel in width. A Canvas Page can be any height, although you will see scrollbars by default if the height exceeds the bounds of outer Facebook.com page. You can control this behavior by turning off scrollbars in the Developer App and using the setSize() function in our JavaScript SDK
精彩评论