Some of the information here may be outdated, please check the book instead

Many people ask if they can use the web2py Database Abstraction Layer without using the framework.

Yes, this is possible, assuming you have the proper database drivers (psycopg2 for PostgreSQL, mysqldb for MySQL, cs_oracle for Oracle, pyodbc for MSSQL, DB2, FireBird)

  • Download the web2py source
  • Move the gluon folder into the Python/lib/site-packages folder
  • use it


from gluon.sql import DAL, Field

print db.tables

print db.friend.fields

for row in db().select(,

You can also use it in the google app engine


read more

download code

© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.