1. Rod Morison
  2. Cones

Wiki

Clone wiki

Cones / Home

Welcome to Cones

Cones is a python web stack, borrowing design and tools from pylons, but lighter and simpler. The current target is Google App Engine. The project was inspired by a Facebook app implemented on Google app engine. The Facebook support attempts to provide automatic and consistent OAuth access tokens somewhat transparently to webapp controllers.

In addition, some pylons-ish features are provided, including Mako, FormEncode and WebHelpers. Beaker is not presently supported, rather the more native/efficient gae-sessions is implemented.

At this time the initial code is in active development. The 0.5 label is really 0.5exp. No version tags or pypi have been created. An official release will wait for external feedback and some clarity whether this needs to be a release managed project.

FAQ

Why Cones?

Why pylons? Why rails? Why why?

How do I run an example?

You're going to need some familarity with Google App Engine. You'll need the app engine dev environment installed and working.

See the README for an admittedly sketchy installation walkthrough of a "sandbox" sample site. If I get enough questions and wtf's I'll beef up the tutorial.

How do I request Facebook extended permissions?

EXTENDED_PERMS in config.py

How do I customize the FbUserBase model in fbuser.py consistent with the auth platform in fbcontroller.py?

FbUserBase inherits from polymodel.PolyModel and can be extended by python class inheritance. However, config.FbUser must be set to the inherited class to instruct the auth system to create the correct types at login/authcheck time. Otherwise you'll end up with bunch of FbUserBase's!

Is there any other way to extend FbUserBase?

Some consideration was given to using Expando for FbUserBase, allowing arbitrary fields without the complexity of inheritance. It's likely if/when this platform evolves Expando support will be added.

Are there more ways to extend FbUserBase?

Why yes, funny you should ask.

  • Create an extension model and use datastore references/collections to FbUserBase to create a "backpointer" from FbUserBase to the extension.
  • Just hack the fbuser.py code...the authentication system relies on the FbUserBase.create_or_update class function to create/access records. As long as that's implemented faithfully, auth should work. You'll certainly need an id and access_token field, but the rest is app specific. (Not that I've actually validated any of this!).

Why Mako (and not the native Django templates)

I prefer Mako for many reasons: template functions, inside out+outside in construction, inline python (when you need it), ..., and above all, compiles to native python and executes as such. That said, Django templates would be easy to fold in, but hasn't hit my requirements (yet).

What about cached/compiled Mako files

Create a file on app engine? Heh! Can't say I blame 'em though. However, there is an appnote for Mako caching on app engine that I haven't tried because I haven't seen the need for that optimization...yet.

Can I hijack your sandbox app with the app secret checked in to bitbucket?

Go ahead, make my day.

Updated