It's not pylons, it's cones! Seriously, a "pylons-lite" webapp framework with facebook app utilities, presently targeted for GAE, but extensible to other wsgi platforms.
Getting Cones and Running the Sandbox App
From a shell:
hg clone https://email@example.com/rmorison/cones cd cones virtualenv conehead coneheadScriptsactivate.bat # linux/macos: source/bin/activate python setup.py sdist pip install -f file://%CD%/dist -r requirements.txt # linux/macos: s/%CD%/$PWD/ python conessite.py conehead sandbox
Facebook and Appengine config:
You'll need an iframe facebook app setup from http://www.facebook.com/developers/apps.php with the canvas url pointing to your server/path. Also, set a deauthorize url to server/path/auth/deauthorize, if you want cones to track app deauthorize requests.
Review the sandbox/config*.py files and make appropriate changes, specifically the items in config_dev.py and/or config_stage.py: FB_APP_ID, FB_APP_SECRET, FB_URI, APP_HOST, APP_PATH. Also, update the app names(s) in config.py if you are pushing to App Engine.
Getting on the net:
To run sandbox under the appengine devserver against facebook you'll need a public IP. Some ways of doing this are 1 - put your dev machine on the net with a public IP (not recommended) 2 - port forward from your public IP to your dev instance 3 - have a webserver proxy from a public IP to your instance
I do the latter with apache and my config is
- <IfModule mod_proxy.c>
- <Proxy *>
- Order Deny,Allow Allow from all
For more info see http://bitbucket.org/rmorison/cones
Go for it:
If everything's wired up correctly, try your facebook app url, e.g., http://apps.facebook.com/myapp/, or one of the auth test urls, http://apps.facebook.com/myapp/auth/test/login , http://apps.facebook.com/myapp/auth/test/verify
This library is in a very experimental dev stage. As the man says: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. Issues, comments, suggestions via bitbucket, or however else you might find me.
Cones includes code from http://github.com/facebook/python-sdk/ and https://github.com/dound/gae-sessions, because these are not distributed in a distutils friendly fashion. Both are distributed under the Apache 2.0 license cited below.
Code in cones/fb*.py is adapted from the facebook python sdk at http://github.com/facebook/python-sdk/. All original code herein is licensed under the same terms as http://github.com/facebook/python-sdk/, namely the Apache License, Version 2.0:
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
Rod Morison, Nov 2010