Port of web2py to Bottle, Flask, Pyramid, Tornado, wsgiref and other frameworks
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
gluino synced with web2py Jul 12, 2013
static resync dal.py Apr 12, 2012
templates added static support Mar 13, 2012
README.markdown edited READEME Mar 28, 2012
bottle_example.py synced DAL with web2py Mar 28, 2012
tornado_example.py resync dal.py Apr 12, 2012
wsgiref_example.py synced DAL with web2py Mar 28, 2012


About gluino

Port of web2py libraries to Bottle, Flask, Pyramid, Tornado, and Wsgiref with examples.

This is a project that started during the PyCon 2012 sprint.

Author: Massimo Di Pierro

License: Web2py license (LGPL) applies to files in gluino/ folder

On PyPI: http://pypi.python.org/pypi/Gluino

The port includes;


  • bottle_example.py
  • flask_example.py
  • pyramid_example.py
  • tornado_example.py
  • wsgiref_example.py

pyramid_example.py is also known as web2pyramid. It was anticipated long ago but never came to be, until now!

All the examples include the same common code:



form = SQLFORM(db.person)
if form.accepts(vars):
    message = 'hello %s' % form.vars.name
    message = 'hello anonymous'
people = db(db.person).select()
now  = cache.ram('time',lambda:time.ctime(),10)
return locals()

and execute the same template:

{{extend 'templates/layout.html'}}
<h2>Test caching time</h2>
<h2>A static image</h2>
<img src="/static/cat.jpg" />

which generates the same output on all the frameworks:


What is missing (compared with web2py)

Note these are not really limitations. We just assume that if you use, for example, Flask with gluino, you want to use the Flask sessions and not the web2py sessions. Same for access control. Moreover we assume that if you want to use the web2py client size styles and JavaScript, you can copy them yourself from the web2py scaffolding app.

  • sessions (you have to use the session provided by the host framework)
  • web2py routing (you have to the routing mechanism of the host framework)
  • multi-app support (only web2py does that well)
  • the web based IDE (only web2py has it)
  • web2py internationalization (you have to use i18n)
  • the Role Based Access Control (you have to use the host framework's API)
  • web2py's CRON and Scheduler
  • form.process() (you have to use form.accepts(...) but works the well)
  • everything in contrib (because we did not package it but you can copy it over)
  • web2py.js (because we did not package static files here but you can copy it from web2py into static)


While we guarantee backward compatibility for web2py, we cannot guaranteed backward compatibility for this API since it is very new. Yet the files included here are a subset of web2py/gluon/*.py. We only added the wrapper object (in gluino/init.py) and the examples.


  • more testing