web2py - Enterprise Web Framework
November 5, 2007
web2py Enterprise Web Framework is a new open source full-stack framework for agile development of database driven web based applications. It written in Python and programmable in Python.

The questions everybody asks are why I made it and why is it better than the other ones. I am trying to answer those questions here.
I have no time for a detailed comparison so I will only discuss what I believe are web2py’s strengths.
- web2py was designed to be super easy to use and I believe it excels at that. Any programmer with 3 hours of Python training can use web2py.
- You can (do not have to) do everything including development of new web applications and database management, through the provided web interface.
- web2py has no dependencies, requires no installation and no configuration. I carry it on a USB drive so that I can run my apps everywhere.
- web2py comes packaged with everything you need for development, including a web server and a SQL database. Windows, Mac and Linux versions.
- web2py manages cookies, session, cache and application errors for you. If there is an error in your application or in web2py itself, the error is never reported to the user but it is logged and a ticker number is issued to the user. Only the administrator can then retrieve the error from the ticket for debugging purposes.
- web2py allows you to byte-code compile applications and distribute them in open source or in closed source form. To some users this important.
- web2py’s templating language is 100% Python although without indentation requirements (you close the blocks using the keyword “pass”). That means you do not need to learn a new language for the templates and you are not limited in what you can do.
- web2py’s Object Relation Mapper is based on the concept of Set. A Set is defined by a condition that can apply to a single table (db.table1.field1==somevalue) or multiple tables (db.table1.field1==db.table2.field2). All operations (insert, delete, select, and update) are performs on Sets. Sets can be united (|) and intersected (&). Once an operation is called on a set, web2py figures out which tables are involved, writes the SQL query for you, sends the SQL query to the database (SQLite3 or PostgreSQL) retrieves the records and packages them into Python object.
- web2py’s ORM supports migrations. You use web2py’s web interface to define the tables in the database. If the tables are not there they are created. If the definition changes the tables are ALTERed accordingly.
- Once the tables are created web2py also provides a web based administrative interface to the database.
- web2py is designed for security. All URLs are validated to block directory traversal attacks, SQL variables are escaped and form fields are validated to block SQL injections, forms prevent double submission to block reply attacks, passwords are encrypted (HMAC+SHA512) and all uploaded files are renamed.
- In web2py you build the views(templates) using HTML but occasionally you may need to generate HTML programmatically. For this purpose web2py comes with helpers called HTML, BODY, H1, A, P, LU, LI, etc.. You get the idea. Yes they are trivial but they allow you to build objects that on the one side can be serialized in HTML and, on the other side, are aware of themselves therefore they can manipulate information and be manipulated. For example FORM(TABLE(TR(TD(INPUT(…))))) is a form capable of processing POST and GET variables, validate them, change itself to include error messages if the variables are not validated.
- web2py supports internationalization. Translations are edited via the web interface.
- web2py has a top-down design therefore its API were stable from day one and I have no plan to change them.
- web2py comes with extensive documentation and many ready made applications that we can appliances.
I just hope I sparkled your interest so that you will give it a try.
If you like it and you let me know you will make me happy.
If you have suggestions for improvement let me know also.