<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Web2py</id>
	<title>Web2py - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Web2py"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Web2py&amp;action=history"/>
	<updated>2026-05-14T10:36:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Web2py&amp;diff=6963935&amp;oldid=prev</id>
		<title>imported&gt;Frap: /* Database handling */ code style Black</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Web2py&amp;diff=6963935&amp;oldid=prev"/>
		<updated>2025-02-03T15:24:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Database handling: &lt;/span&gt; code style Black&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Python-based web framework}}&lt;br /&gt;
{{Self-published|date=April 2024}}&lt;br /&gt;
{{lowercase title}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| title = web2py Enterprise Web Framework&lt;br /&gt;
| name = web2py&lt;br /&gt;
| logo = ويب-تو-باي.png&lt;br /&gt;
| logo size = frameless&lt;br /&gt;
| logo caption = web2py logo&lt;br /&gt;
| screenshot = &amp;lt;!-- [[File: ]] --&amp;gt;&lt;br /&gt;
| caption = &lt;br /&gt;
| collapsible = &lt;br /&gt;
| author = Massimo Di Pierro&lt;br /&gt;
| released = {{Start date and age|2007|09|27}}&lt;br /&gt;
| discontinued = &lt;br /&gt;
| latest release version = {{wikidata|property|reference|edit|P348}}&lt;br /&gt;
| latest release date    = {{start date and age|{{wikidata|qualifier|P348|P577}}}}&lt;br /&gt;
| latest preview version = &lt;br /&gt;
| latest preview date = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| repo = {{URL|https://github.com/web2py/web2py|Web2py Repository}}&lt;br /&gt;
| programming language = [[Python (programming language)|Python]]&lt;br /&gt;
| operating system = &lt;br /&gt;
| platform = [[Cross-platform]]&lt;br /&gt;
| size = &lt;br /&gt;
| language = &lt;br /&gt;
| language count = &amp;lt;!-- DO NOT include this parameter unless you know what it does --&amp;gt;&lt;br /&gt;
| language footnote = &lt;br /&gt;
| genre = [[Web application framework]]&lt;br /&gt;
| license = [[LGPL|GNU Lesser General Public License]] version 3 (LGPLv3)&lt;br /&gt;
| alexa = &lt;br /&gt;
| website = [http://www.web2py.com www.web2py.com]&lt;br /&gt;
| standard = &lt;br /&gt;
| AsOf = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Web2py&amp;#039;&amp;#039;&amp;#039; is an [[open-source software|open-source]] [[web application framework]] written in the [[Python (programming language)|Python]] [[programming language]]. Web2py allows [[web developers]] to program [[dynamic web content]] using [[Python (programming language)|Python]]. Web2py is designed to help reduce tedious web development tasks, such as developing [[web form]]s from scratch, although a web developer may build a [[form (HTML)|form]] from scratch if required.&amp;lt;ref name=web2py&amp;gt;{{cite web| publisher=Web2py| title=What is web2py?| website=web2py.com|access-date=2023-10-31 | url=http://www.web2py.com/init/default/what}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Web2py was originally designed as a teaching tool with emphasis on ease of use and [[Software deployment|deployment]]. Therefore, it does not have any project-level configuration files. The design of web2py was inspired by the [[Ruby on Rails]] and [[Django (web framework)|Django]] frameworks. Like these frameworks, web2py focuses on [[Rapid application development|rapid development]], favors [[convention over configuration]] approach and follows a [[model–view–controller]] (MVC) [[Architectural pattern (computer science)|architectural pattern]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
Web2py is a [[full-stack framework]] in that it has built-in components for all major functions, including:&lt;br /&gt;
* [[HTTP]] requests, HTTP responses, [[Web cookie|cookies]], [[Session (computer science)|sessions]];&lt;br /&gt;
* multiple protocols&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/226 Web2py speaks multiple protocols since v1.63]&amp;lt;/ref&amp;gt; [[HTML]]/[[XML]], [[Representational State Transfer|REST]], [[Atom (web standard)|ATOM]] and [[RSS]], [[Rich Text Format|RTF]] and [[Comma-separated values|CSV]], [[JSON]], [[JSON-RPC]] and [[XML-RPC]], [[Action Message Format|AMF-RPC]] ([[Adobe Flash|Flash]]/[[Adobe Flex|Flex]]), and [[SOAP]];&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/165 Using SOAP with web2py]&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [[Create, read, update and delete|CRUD]] [[API]];&lt;br /&gt;
* multiple [[authentication]] mechanisms and [[role-based access control]];&lt;br /&gt;
* [[database abstraction layer]] (DAL) that dynamically generates [[SQL]] and runs on multiple compatible database backends;&lt;br /&gt;
* [[Random-access memory|RAM]], [[Hard disk drive|disk]], and [[memcached]]-based [[Cache (computing)|caching]] for [[scalability]];&lt;br /&gt;
* [[I18n|internationalization]] support;&lt;br /&gt;
* [[jQuery]] for [[Ajax (programming)|Ajax]] and [[user interface|UI]] effects;&lt;br /&gt;
* automatic logging of errors with context.&lt;br /&gt;
&lt;br /&gt;
Web2py encourages sound [[software engineering]] practices such as&lt;br /&gt;
* the [[model–view–controller]] (MVC) pattern;&lt;br /&gt;
* self-submission&amp;lt;ref&amp;gt;[http://evolt.org/writing_smart_web-based_forms Writing Smart Web-based Forms]&amp;lt;/ref&amp;gt; of [[web form]]s;&lt;br /&gt;
* [[server-side]] sessions;&lt;br /&gt;
* safe handling of uploaded files.&lt;br /&gt;
&lt;br /&gt;
Web2py uses the [[Web Server Gateway Interface|WSGI]] protocol, the Python-oriented protocol for [[communication]] between [[web server]] and web applications. It also provides handlers for [[Common Gateway Interface|CGI]] and the [[FastCGI]] protocols, and it includes the [[Thread (computer science)|multi-threaded]], [[Transport Layer Security|SSL]]-enabled Rocket&amp;lt;ref&amp;gt;[https://launchpad.net/rocket Rocket Web Server]&amp;lt;/ref&amp;gt; wsgiserver.&lt;br /&gt;
&lt;br /&gt;
==Distinctive features==&lt;br /&gt;
&lt;br /&gt;
=== Web-based integrated development environment (IDE) ===&lt;br /&gt;
All [[Software development|development]], [[debugging]], [[Software testing|testing]], [[Software maintenance|maintenance]] and remote database administration can (optionally) be performed without third-party tools, via a web interface, itself a web2py application. [[Internationalization and localization|Internationalization]] (adding languages and writing translations) can also be performed from this [[Integrated development environment|IDE]]. Each application has an automatically generated database administrative interface, similar to [[Django (web framework)|Django]]. The web IDE also includes web-based testing.&lt;br /&gt;
&lt;br /&gt;
Applications can also be created from the [[command line]] or developed with other IDEs.&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/178 Web2py online IDE] with &amp;#039;&amp;#039;[https://addons.mozilla.org/hu/firefox/addon/4125 It&amp;#039;s All Text!]&amp;#039;&amp;#039; Firefox addon and [https://code.google.com/p/ulipad Ulipad] (open source Python IDE)&amp;lt;/ref&amp;gt; Further debugging options:&amp;lt;ref&amp;gt;[https://stackoverflow.com/questions/315165/how-to-debug-web2py-applications How to debug Web2py applications?]&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [[Wing IDE]] allows graphical debugging of web2py applications&amp;lt;ref&amp;gt;[http://www.wingware.com/doc/howtos/web2py Wing IDE supports debugging for web2py]&amp;lt;/ref&amp;gt; as you interact with it from your web browser, you can inspect and modify variables, make function calls etc.&lt;br /&gt;
* [[Eclipse (software)|Eclipse]]/[[PyDev]] — Eclipse with the Aptana PyDev plugin — supports web2py as well.&amp;lt;ref&amp;gt;[http://groups.google.com/group/web2py/browse_thread/thread/c27b4f7cf3328520 Eclipse/PyDev supports debugging for web2py]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://allisterx.blogspot.com/2009/06/using-web2py-framework-on-eclipse.html Using web2py on Eclipse]&amp;lt;/ref&amp;gt;&lt;br /&gt;
* The extensible pdb debugger is a module of Python&amp;#039;s standard library.&lt;br /&gt;
* With the platform-independent open-source Winpdb debugger, one can perform remote debugging&amp;lt;ref&amp;gt;[http://winpdb.org/docs/requirements/ With Winpdb one can do remote debugging over TCP/IP]&amp;lt;/ref&amp;gt; over [[TCP/IP]], through encrypted connection.&amp;lt;ref&amp;gt;[http://winpdb.org/docs/security/ Encrypted communication in Winpdb]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[&amp;quot;Hello, World!&amp;quot; program|Hello World]] program with web2py in its simplest form (simple web page&amp;lt;ref&amp;gt;[http://www.web2py.com/examples/simple_examples/hello1 Simplest web page with web2py: &amp;quot;Hello World&amp;quot; example]&amp;lt;/ref&amp;gt; with no template) looks like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def hello():&lt;br /&gt;
    return &amp;#039;Hello World&amp;#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Web2py includes pure Python-based [[Template engine (web)|template language]], with no [[Indent style|indentation]] requirements and a server-side Document Object Model ([[Document Object Model|DOM]]).&lt;br /&gt;
The template system works without web2py.&amp;lt;ref&amp;gt;[http://groups.google.com/group/web2py/browse_thread/thread/c81061bc00c6181e How to use web2py templates without web2py]&amp;lt;/ref&amp;gt; [[Joomla]] 1.x templates can be converted to web2py layouts.&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/167 Using Joomla templates with web2py]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Web2py also includes two markup libraries: the markdown2 text-to-HTML filter, which converts [[Markdown]] markup to HTML [[on the fly]]; and markmin which is inspired by markdown but supports tables, html5 video/audio and oembed protocol.&lt;br /&gt;
&lt;br /&gt;
A [[Model–view–controller#Components|controller]] without a view automatically uses a generic view that render the variables returned by the controller, enabling the development of an application&amp;#039;s business logic before writing HTML. The &amp;quot;Hello World&amp;quot; example using a default template:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def hello():&lt;br /&gt;
    return dict(greeting=&amp;#039;Hello World&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The dict() output of an action is automatically rendered in HTML if the page is request with a .html extension, in JSON if the page is requested with a .json extension, in XML if requested with .xml. It supports other protocols including jsonp, rss, ics, google maps, etc. and is extensible.&lt;br /&gt;
&lt;br /&gt;
Here is a more complex code example which defines a table, and exposes a grid to logged in users:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
db.define_table(&amp;#039;thing&amp;#039;,Field(&amp;#039;name&amp;#039;,notnull=True))&lt;br /&gt;
&lt;br /&gt;
@auth.requires_login()&lt;br /&gt;
def hello():&lt;br /&gt;
    return dict(grid = SQLFORM.grid(db.thing))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ticketing system===&lt;br /&gt;
Each web2py application comes with a [[Issue tracking system|ticketing system]]:&lt;br /&gt;
* If an error occurs, it is logged and a ticket is issued to the user. That allows error tracking.&lt;br /&gt;
* Errors and source code are accessible only to the administrator, who can search and retrieve errors by date or client-IP. No error can result in code being exposed to the users.&lt;br /&gt;
&lt;br /&gt;
===Portable cron===&lt;br /&gt;
Cron is a mechanism for creating and running recurrent tasks in background. It looks for an application-specific [[crontab]] file which is in standard crontab format. Three modes of operation are available:&lt;br /&gt;
* Soft cron: [[cron]] routines are checked after web page content has been served, does not guarantee execution precision. For unprivileged Apache CGI/WSGI installs.&lt;br /&gt;
* Hard cron: a cron [[Thread (computer science)|thread]] gets started on web2py startup. For Windows and Rocket/standalone web2py installs.&lt;br /&gt;
* System cron: cron functions get force-called from the [[command line]], usually from the system crontab. For Unix/Linux systems and places where the cron triggers need to be executed even if web2py is not running at the moment; also good for CGI/WSGI installs if you have access to the system crontab.&lt;br /&gt;
&lt;br /&gt;
===Scheduler===&lt;br /&gt;
Since version 2.3 the use of cron is discouraged since web2py comes with a master/worker scheduler. Jobs can be defined in models and are scheduled by creating an entry in the database. Users can start work processes who pickup and execute tasks in background. The schedule is better than cron because it allows to specify more parameters (start time, stop time, number of repetitions, number of trials in case of error) and do a better job at running within constant resource utilization.&lt;br /&gt;
&lt;br /&gt;
===Bytecode distribution===&lt;br /&gt;
Web2py can compile web applications for distribution in [[bytecode]] compiled form, without source code. Unlike frameworks that use specialized template languages for their views, Web2py can also compile the view code into bytecode, since it is pure Python code.&lt;br /&gt;
&lt;br /&gt;
===Global Environment===&lt;br /&gt;
{{more citations needed|date=November 2013}}&lt;br /&gt;
Web2py is unique in the world of Python web frameworks because models and controllers are executed, not imported. They are not modules. They are executed in a single global environment which is initialized at each HTTP request. This design decision has pros and cons.&lt;br /&gt;
&lt;br /&gt;
The major pro is the ease of development, specifically for rapid prototyping. Another pro is that all the objects defined within this environment are cleanly reset at each HTTP request and never shared across requests. This means the developer does not need to worry about changing the state of an object (for example the readable attribute of a database field) or worry about a change leaking to other concurrent requests or other applications. A third advantage is that web2py allows the coexistence of multiple applications under the same instance without conflicts even if they use different versions of the same modules or different modules with the same name.&lt;br /&gt;
&lt;br /&gt;
The main disadvantage of the global environment is that model files and controller files are not modules and the order of execution matters (although it can be specified using conditional models). Naming conflict is more likely to occur than in normal Python modules. Some standard Python development tools may not understand objects defined in models and controllers. Moreover, developers must be aware that code in models is executed at every request and this may cause a performance penalty. Nothing in web2py prevents developers from using and importing normal Python modules (model-less approach) and for this purpose web2py provides a thread local object (current) to facilitate access to objects associated to the current request. Yet, in this case, the developer has to be aware of the same pitfalls that other frameworks incur: changing the state of an object defined in a module may affect other concurrent requests.&lt;br /&gt;
&lt;br /&gt;
Another con is that, because models and controllers are not class-based, efficient code reuse becomes more difficult, particularly as the inability to inherit from a parent controller (e.g. the ApplicationController in Ruby on Rails) means that common controller functionality must be referenced repeatedly across all controller files.&lt;br /&gt;
&lt;br /&gt;
==Supported environments==&lt;br /&gt;
&lt;br /&gt;
=== Operating systems, Python versions &amp;amp; implementations, virtual machines, hardware ===&lt;br /&gt;
web2py runs on [[Microsoft Windows|Windows]], [[Windows CE]] phones, [[Macintosh|Mac]], [[Unix]]/[[Linux]], [[Google App Engine]], [[Amazon EC2]], and almost any web hosting via Python 2.7/3.5/3.6/pypy.&amp;lt;ref name=web2py/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current binary version of web2py (for Windows or Mac) includes Python 2.7, but the source version can be run on 2.7 and 3.5+. Support for Python 2.6 has been dropped on 2017.&lt;br /&gt;
&lt;br /&gt;
web2py since v1.64.0 runs unmodified on [[Java (software platform)|Java]] with [[Jython]] 2.5, without any known limitation.&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/228 Web2py runs fully on Java and J2EE using Jython]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
web2py code can run with [[IronPython]] on [[.NET Framework|.NET]].&amp;lt;ref&amp;gt;[https://stackoverflow.com/questions/437160/ironpython-webframework Web2py runs with IronPython on .NET, with limitations]&amp;lt;/ref&amp;gt; Limitations:&lt;br /&gt;
* no &amp;#039;&amp;#039;csv&amp;#039;&amp;#039; module (so no database I/O);&lt;br /&gt;
* no third party database drivers (not even [[SQLite]], so no databases at all);&lt;br /&gt;
* no built-in web server (unless you cripple it by removing &amp;#039;&amp;#039;signals&amp;#039;&amp;#039; and &amp;#039;&amp;#039;logging&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
The web2py binary will&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/133 MySQL with web2py Windows binary on a USB thumb-drive]&amp;lt;/ref&amp;gt; run from a [[USB flash drive|USB drive]] or a portable hard drive without dependencies, like Portable Python.&lt;br /&gt;
&lt;br /&gt;
===Web servers===&lt;br /&gt;
Web2py can service requests via [[HTTP]] and [[HTTPS]] with its built-in Rocket server,&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/140 How to run the built-in SSL server]&amp;lt;/ref&amp;gt; with [[Apache HTTP Server|Apache]],&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/38 Web2py with Apache and mod_ssl]&amp;lt;/ref&amp;gt; [[Lighttpd]],&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/19 Web2py with Lighttpd and FastCGI]&amp;lt;/ref&amp;gt; [[Cherokee HTTP Server|Cherokee]],&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/184 Web2py with Cherokee]&amp;lt;/ref&amp;gt; [[Hiawatha (web server)|Hiawatha]], [[Nginx]] and almost any other web server through [[Common Gateway Interface|CGI]], [[FastCGI]], [[Web server gateway interface|WSGI]], [[mod_proxy]],&amp;lt;ref&amp;gt;[http://httpd.apache.org/docs/2.0/mod/mod_proxy.html Apache Module mod_proxy]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/17 Web2py with mod_proxy]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/136 Web2py with mod_proxy and mod_proxy_html]&amp;lt;/ref&amp;gt; and/or [[mod_python]].&lt;br /&gt;
&lt;br /&gt;
===IDEs and debuggers===&lt;br /&gt;
While a number of web2py developers use [[text editors]] such as [[Vim (text editor)|Vim]], [[Emacs]] or [[TextMate]] Web2py also has a built-in web-based IDE. Others prefer more specialized tools providing debugging, refactoring, etc.&lt;br /&gt;
*[[Aptana Studio]] with integrated [[PyDev]]&lt;br /&gt;
*[[Eclipse ide|Eclipse]] with [[PyDev]]&lt;br /&gt;
*[[Eric]] with built-in debugger.&amp;lt;ref&amp;gt;[http://eric-ide.python-projects.org Eric IDE Project]&amp;lt;/ref&amp;gt;&lt;br /&gt;
*[[Wing IDE]]&amp;lt;ref&amp;gt;[http://www.wingware.com/doc/howtos/web2py Using Wing IDE with web2py]&amp;lt;/ref&amp;gt;&lt;br /&gt;
*[[Microsoft Visual Studio]] with [[Python Tools for Visual Studio]]&lt;br /&gt;
* [[PyCharm|Pycharm]]3 has Web2py framework support&lt;br /&gt;
&lt;br /&gt;
==Database handling==&lt;br /&gt;
The database abstraction layer ([[Data access layer|DAL]]) of web2py dynamically and transparently generates SQL queries and runs on multiple compatible database backend without the need for database-specific SQL commands (though SQL commands can be issued explicitly).&lt;br /&gt;
&lt;br /&gt;
[[SQLite]] is included in Python and is the default web2py database. A connection string change allows connection to [[Firebird (database server)|Firebird]], [[IBM Db2]], [[Informix]], [[Ingres (database)|Ingres]], [[Microsoft SQL Server]], [[MySQL]], [[Oracle Database|Oracle]], [[PostgreSQL]], and [[Google App Engine]] (GAE) with some caveats. Specialities:&lt;br /&gt;
* Multiple database connections.&lt;br /&gt;
* Automatic table creates and alters.&lt;br /&gt;
* Automatic [[Database transaction|transaction]]s.&lt;br /&gt;
* [[Distributed transaction]]s:&lt;br /&gt;
** Since web2py v1.17 with PostgreSQL v8.2 and later,&amp;lt;ref&amp;gt;[http://mdp.cti.depaul.edu/AlterEgo/default/show/70 Distributed transactions with PostgreSQL]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://groups.google.com/group/web2py/browse_thread/thread/235ed49f620a3c3d Distributed transactions with PostgreSQL — further details]&amp;lt;/ref&amp;gt; because it provides API for [[Two-phase commit protocol|two-phase commit]]s.&lt;br /&gt;
** Since web2py v1.70.1 with Firebird and MySQL (experimental).&lt;br /&gt;
* GAE is not a relational store, but web2py emulates certain operations.&lt;br /&gt;
&lt;br /&gt;
The DAL is fast, at least comparable with [[SQLAlchemy]] and [[Storm (software)|Storm]].&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/76 ORM Benchmark]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Web2py implements a DAL, not an [[Object-relational mapping|ORM]]. An ORM [[Data mapping|map]]s database tables into [[Class (computer science)|class]]es representing logical abstractions from the database layer (e.g., a User class or a PurchaseOrder class), and maps records into [[Object (computer science)|instance]]s of those classes. The DAL instead maps database tables and records into instances of classes representing sets and records instead of higher-level abstractions. It has very similar [[Syntax (programming languages)|syntax]] to an ORM but it is faster, and can map almost any SQL expressions into DAL expressions. The DAL can be used independently of the rest of web2py.&amp;lt;ref&amp;gt;[http://www.web2py.com/AlterEgo/default/show/215 How to use web2py DAL without web2py]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are some examples of DAL syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
db = DAL(&amp;quot;postgresql://user:pass@localhost/db&amp;quot;, pool_size=10)&lt;br /&gt;
db.define_table(&amp;quot;person&amp;quot;, Field(&amp;quot;name&amp;quot;), Field(&amp;quot;image&amp;quot;, &amp;quot;upload&amp;quot;))&lt;br /&gt;
db.person.insert(name=&amp;quot;Martin&amp;quot;, image=open(&amp;quot;filename.png&amp;quot;))&lt;br /&gt;
rows = db((db.person.name == &amp;quot;Martin&amp;quot;) | db.person.name.contains(&amp;quot;T&amp;quot;)).select(&lt;br /&gt;
    orderby=db.person.name.lower()&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The latest version of the DAL has support for 2D GIS functions with Spatialite and PostGIS. The current API are experimental because of a possible move to 3D APIs.&lt;br /&gt;
&lt;br /&gt;
===Automatic database migrations===&lt;br /&gt;
web2py supports database [[Data migration|migration]]s—change the definition of a table and web2py ALTERs the table accordingly. Migrations are automatic, but can be disabled for any table, and migration is typically disabled when an application is ready for live distribution. Migrations and migration attempts are logged, documenting the changes.&lt;br /&gt;
&lt;br /&gt;
Limitations:&lt;br /&gt;
* SQLite cannot alter table and change a column type, but rather simply stores new values according to the new type.&lt;br /&gt;
* GAE has no concept of alter-table, so migrations are limited.&lt;br /&gt;
&lt;br /&gt;
==Licenses==&lt;br /&gt;
Web2py code is released under [[LGPL|GNU Lesser General Public License]] (LGPL) version 3 as of web2py version 1.91.1.&amp;lt;ref&amp;gt;[http://www.web2py.com/examples/default/license web2py License Agreement]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Web2py code before version 1.91.1 was released under [[GNU General Public License#Version 2|GNU GPL v2.0]] with commercial exception.&lt;br /&gt;
&lt;br /&gt;
Various third-party packages distributed with web2py have their own licenses, generally [[public domain]], [[MIT]] or [[BSD]]-type licenses. Applications built with web2py are not covered by the LGPL license.&lt;br /&gt;
&lt;br /&gt;
Web2py is copyrighted by Massimo DiPierro. The web2py trademark is owned by [[Massimo DiPierro]].&lt;br /&gt;
&lt;br /&gt;
==Awards==&lt;br /&gt;
In 2011 [[InfoWorld]] ranked web2py highest among the top six Python web frameworks, awarded web2py the Bossie award 2011 for best open source application development software. In 2012 web2py won the [[InfoWorld]] Technology of the Year award.&amp;lt;ref&amp;gt;{{Cite news|url=http://www.infoworld.com/d/application-development/pillars-python-six-python-web-frameworks-compared-169442|title=Pillars of Python: Six Python Web frameworks compared|last=Grehan|first=Rick|work=InfoWorld|access-date=2017-11-30|language=en}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite news|url=http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23|title=InfoWorld&amp;#039;s 2012 Technology of the Year Award winners|last=staff|first=InfoWorld Reviews|work=InfoWorld|access-date=2017-11-30|language=en}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Publications==&lt;br /&gt;
&lt;br /&gt;
=== web2py Book ===&lt;br /&gt;
The base web2py documentation is The Official web2py Book, by  [[#Developers|Massimo DiPierro]]. The manual is a full web2py application and it&amp;#039;s freely available online,&amp;lt;ref&amp;gt;{{Cite web|url=http://web2py.com/book|title=web2py - The official manual online|website=web2py.com|language=en-us|access-date=2018-11-14}}&amp;lt;/ref&amp;gt; in PDF format or printed form.&lt;br /&gt;
* 1st Edition: [[out of print]]. [[John Wiley &amp;amp; Sons|Wiley]]; September 16, 2008; 256 pages; {{ISBN|978-0-470-43232-7}}.&lt;br /&gt;
* 2nd Edition: web2py Manual. Wiley; August 26, 2009; 341 pages; {{ISBN|978-0-470-59235-9}}. &lt;br /&gt;
* 3rd Edition: Lulu; September 25, 2010 357 pages.&lt;br /&gt;
* 4th Edition: Lulu; December 9, 2011 583 pages.&lt;br /&gt;
* 5th Edition: PDF Copy; March 3, 2013 614 pages; {{ISBN|978-0-578-12021-8}}.&lt;br /&gt;
*latest online sources: on GitHub&amp;lt;ref&amp;gt;{{Cite web|url=https://github.com/web2py/web2py-book|title=web2py/web2py-book|website=GitHub|language=en|access-date=2018-11-14}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Online documentation===&lt;br /&gt;
Online documentation is linked from the web2py home page, with [[Cookbook#Usage outside the world of food|cookbook]], videos, interactive examples, interactive API reference, epydoc s (complete library reference), [[FAQ]], [[Cheat sheet#As reference cards|cheat sheet]], online tools etc.&lt;br /&gt;
* Cheat sheet for web2py.&lt;br /&gt;
* web2pyslices, recipes posted using the movuca social network in web2py.&lt;br /&gt;
* Crash Course in Web2py (5-part series).&lt;br /&gt;
* Web2py slides (old).&lt;br /&gt;
&lt;br /&gt;
===Videos===&lt;br /&gt;
* &amp;#039;&amp;#039;web2py Enterprise Web Framework Tutorial&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;web2py &amp;quot;Shootout&amp;quot; video tutorial&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;web2py on the Google appengine&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;web2py: Create, edit, and deploy a basic web app&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
===Printed===&lt;br /&gt;
* &amp;quot;web2py application development cookbook&amp;quot;, Packt, 2012&lt;br /&gt;
* &amp;#039;&amp;#039;Web programming with web2py&amp;#039;&amp;#039;; &amp;#039;&amp;#039;Python Magazine&amp;#039;&amp;#039;; Marco Tabini &amp;amp; Associates, Inc.; June 2008&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
===Developers===&lt;br /&gt;
The lead developer of web2py is Massimo DiPierro, an associate professor of [[Computer Science]] at [[DePaul University]] in [[Chicago]]. As of 2011, the web2py homepage lists over 70 &amp;quot;main contributors&amp;quot;.&amp;lt;ref&amp;gt;[http://www.web2py.com/examples/default/who List of main contributors to web2py]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Development source code===&lt;br /&gt;
The web2py development source code is available from the main repository:&lt;br /&gt;
* [[Git (software)|Git]] on [[GitHub]]: Web2Py&lt;br /&gt;
&lt;br /&gt;
=== Third-party software included in web2py ===&lt;br /&gt;
* Python-based [[Component-based software engineering|components]]:&lt;br /&gt;
** Rocket, a fast, [[HTTP/1.1]]-compliant, [[Thread (computer science)|multi-threaded]], [[Transport Layer Security|SSL]]-enabled and [[Streaming media|streaming]]-capable [[Web Server Gateway Interface|WSGI]] server;&lt;br /&gt;
** fcgi.py: a [[FastCGI]]/[[Web Server Gateway Interface|WSGI]] gateway;&lt;br /&gt;
** Login API for Janrain, Dropbox, Google, LDAP, PAM, X509, CAS, OpenID, OAuth 1&amp;amp;2, Loginza&lt;br /&gt;
** simplejson: a simple, fast, complete, correct and extensible [[JSON]] encoder and decoder;&lt;br /&gt;
** markdown2: a [[Markdown]] processor;&lt;br /&gt;
** fpdf a library for PDF generation;&lt;br /&gt;
** PyRTF: an [[Rich Text Format|RTF]] document generator;&lt;br /&gt;
** a [[syntax highlight]]er;&lt;br /&gt;
** pysimplesoap for SOAP services;&lt;br /&gt;
** PyRSS2Gen: an [[RSS]] generator;&lt;br /&gt;
** feedparser: to parse RSS and [[Atom (standard)|Atom]] feeds.&lt;br /&gt;
* [[JavaScript]]-based components:&lt;br /&gt;
** [[jQuery]]: a lightweight [[JavaScript library]];&lt;br /&gt;
** [[CodeMirror]]: a free editor for source code;&lt;br /&gt;
* [[C (programming language)|C]]-based components:&lt;br /&gt;
** [[SQLite]]: a [[relational database]];&lt;br /&gt;
** [[memcached]]: a general-purpose distributed memory caching system.&lt;br /&gt;
** Payment API for Authorize.Net, Google Wallet, Stripe.com&lt;br /&gt;
&lt;br /&gt;
==History and naming==&lt;br /&gt;
The source code for the first public version of web2py was released under GNU GPL v2.0 on 2007-09-27 by [[#Developers|Massimo DiPierro]] as the &amp;#039;&amp;#039;Enterprise Web Framework&amp;#039;&amp;#039; (EWF). The name was changed twice due to name conflicts: EWF v1.7 was followed by Gluon v1.0, and Gluon v1.15 was followed by web2py v1.16. The license was changed to LGPLv3 as of web2py version 1.91.1 on 2010-12-21.&lt;br /&gt;
&lt;br /&gt;
==Applications built on Web2py==&lt;br /&gt;
* [[Movuca]] [[Content management system|CMS]] and Social Network Engine.&lt;br /&gt;
* [[Instant Press]] [[Blog]] platform.&lt;br /&gt;
* [[Ourway]] Social networking site.&lt;br /&gt;
* [[NoobMusic]] A rock music website.&lt;br /&gt;
* [[LinkFindr]] Network diagnostic tool.&lt;br /&gt;
* [[StarMaker]] Develops karaoke-style social music apps.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{Reflist|30em}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
{{Portal|Free and open-source software}}&lt;br /&gt;
* {{Official website}}&lt;br /&gt;
&lt;br /&gt;
{{Python web frameworks}}&lt;br /&gt;
{{Web frameworks}}&lt;br /&gt;
&lt;br /&gt;
{{Authority control}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Free content management systems]]&lt;br /&gt;
[[Category:Python (programming language) web frameworks]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Frap</name></author>
	</entry>
</feed>