Web2py
Encyclopedia
Web2py is an open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 web application framework
Web application framework
A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...

. Web2py is written in the Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

 language and is programmable in Python. Since web2py was originally designed as a teaching tool with emphasis on ease of use and deployment
Software deployment
Software deployment is all of the activities that make a software system available for use.The general deployment process consists of several interrelated activities with possible transitions between them. These activities can occur at the producer site or at the consumer site or both...

, it does not have any project
Project
A project in business and science is typically defined as a collaborative enterprise, frequently involving research or design, that is carefully planned to achieve a particular aim. Projects can be further defined as temporary rather than permanent social systems that are constituted by teams...

-level configuration files. Web2py was inspired by Ruby on Rails
Ruby on Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.-History:...

 (RoR) and Django frameworks. Like RoR, it focuses on rapid development
Rapid application development
Rapid application development is a software development methodology that uses minimal planning in favor of rapid prototyping. The "planning" of software developed using RAD is interleaved with writing the software itself...

, favors convention over configuration
Convention over Configuration
Convention over configuration is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility....

 approach and follows Model–View–Controller (MVC) architectural pattern
Architectural pattern (computer science)
An architectural pattern in software is a standard design in the field of software architecture. The concept of a software architectural pattern has a broader scope than the concept of a software design pattern...

.

Overview

Web2py is a full-stack framework in that it has built-in components for all major functions, including:
  • HTTP requests, HTTP responses, cookies, sessions
    Session (computer science)
    In computer science, in particular networking, a session is a semi-permanent interactive information interchange, also known as a dialogue, a conversation or a meeting, between two or more communicating devices, or between a computer and user . A session is set up or established at a certain point...

    ;
  • multiple protocols HTML
    HTML
    HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....

    /XML
    XML
    Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

    , REST
    Representational State Transfer
    Representational state transfer is a style of software architecture for distributed hypermedia systems such as the World Wide Web. The term representational state transfer was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation...

    , ATOM
    Atom
    The atom is a basic unit of matter that consists of a dense central nucleus surrounded by a cloud of negatively charged electrons. The atomic nucleus contains a mix of positively charged protons and electrically neutral neutrons...

     and RSS
    RSS
    -Mathematics:* Root-sum-square, the square root of the sum of the squares of the elements of a data set* Residual sum of squares in statistics-Technology:* RSS , "Really Simple Syndication" or "Rich Site Summary", a family of web feed formats...

    , RTF
    Rich Text Format
    The Rich Text Format is a proprietary document file format with published specification developed by Microsoft Corporation since 1987 for Microsoft products and for cross-platform document interchange....

     and CSV
    Comma-separated values
    A comma-separated values file stores tabular data in plain-text form. As a result, such a file is easily human-readable ....

    , JSON
    JSON
    JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

    , JSON-RPC
    JSON-RPC
    JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol , defining only a handful of data types and commands...

     and XML-RPC
    XML-RPC
    XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism. "XML-RPC" also refers generically to the use of XML for remote procedure call, independently of the specific protocol...

    , AMF-RPC
    Action Message Format
    Action Message Format is a binary format used to serialize objects graphs such ActionScript objects and XML, or send messages between an Adobe Flash client and a remote service, usually a Flash Media Server or third party alternatives....

     (Flash
    Adobe Flash
    Adobe Flash is a multimedia platform used to add animation, video, and interactivity to web pages. Flash is frequently used for advertisements, games and flash animations for broadcast...

    /Flex
    Adobe Flex
    Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform...

    ), and SOAP
    SOAP
    SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks...

    ;
  • CRUD API;
  • multiple authentication
    Authentication
    Authentication is the act of confirming the truth of an attribute of a datum or entity...

     mechanisms and role-based access control
    Role-Based Access Control
    In computer systems security, role-based access control is an approach to restricting system access to authorized users. It is used by the majority of enterprises with more than 500 employees, and can be implemented via mandatory access control or discretionary access control...

    ;
  • database abstraction layer
    Database abstraction layer
    A database abstraction layer is an application programming interface which unifies the communication between a computer application and databases such as SQL Server, DB2, MySQL, PostgreSQL, Oracle or SQLite...

     (DAL) that dynamically generates SQL
    SQL
    SQL is a programming language designed for managing data in relational database management systems ....

     and runs on multiple compatible database backends;
  • RAM
    Random-access memory
    Random access memory is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order with a worst case performance of constant time. Strictly speaking, modern types of DRAM are therefore not random access, as data is read in...

    , disk, and memcached
    Memcached
    In computing, memcached is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the...

    -based caching
    Cache
    In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...

     for scalability
    Scalability
    In electronics scalability is the ability of a system, network, or process, to handle growing amount of work in a graceful manner or its ability to be enlarged to accommodate that growth...

    ;
  • internationalization support;
  • jQuery
    JQuery
    jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML. It was released in January 2006 at BarCamp NYC by John Resig...

     for Ajax
    Ajax (programming)
    Ajax is a group of interrelated web development methods used on the client-side to create asynchronous web applications...

     and UI
    User interface
    The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

     effects;
  • automatic logging of errors with context.


Web2py encourages sound software engineering
Software engineering
Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software...

 practices such as
  • the Model-View-Controller
    Model-view-controller
    Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...

     (MVC) pattern;
  • self-submission of web forms;
  • server-side
    Server-side
    Server-side refers to operations that are performed by the server in a client–server relationship in computer networking.Typically, a server is a software program, such as a web server, that runs on a remote server, reachable from a user's local computer or workstation...

     sessions;
  • safe handling of uploaded files.


Web2py uses the WSGI protocol, the Python-oriented protocol for communication
Communication
Communication is the activity of conveying meaningful information. Communication requires a sender, a message, and an intended recipient, although the receiver need not be present or aware of the sender's intent to communicate at the time of communication; thus communication can occur across vast...

 between web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....

 and web applications. It also provides handlers for CGI
Common Gateway Interface
The Common Gateway Interface is a standard method for web servers software to delegate the generation of web pages to executable files...

 and the FastCGI
FastCGI
FastCGI is a protocol for interfacing interactive programs with a web server. FastCGI is a variation on the earlier Common Gateway Interface ; FastCGI's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing a server to handle more web page...

 protocols, and it includes the multi-threaded
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

, SSL
Transport Layer Security
Transport Layer Security and its predecessor, Secure Sockets Layer , are cryptographic protocols that provide communication security over the Internet...

-enabled Rocket wsgiserver.

Web2py has frequent releases and is easy to update
Patch (computing)
A patch is a piece of software designed to fix problems with, or update a computer program or its supporting data. This includes fixing security vulnerabilities and other bugs, and improving the usability or performance...

.

Web-based integrated development environment (IDE)

All development
Software development
Software development is the development of a software product...

, debugging
Debugging
Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge...

, testing
Software testing
Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software...

, maintenance
Software maintenance
Software Maintenance in software engineering is the modification of a software product after delivery to correct faults, to improve performance or other attributes....

 and remote database administration can (optionally) be performed without third party tools, via a web interface, itself a web2py application. Internationalization
Internationalization and localization
In computing, internationalization and localization are means of adapting computer software to different languages, regional differences and technical requirements of a target market...

 (adding languages and writing translations) can also be performed from this IDE
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

. Each application has an automatically generated database administrative interface, similar to Django. The web IDE also includes web-based testing and a web-based shell
Shell (computing)
A shell is a piece of software that provides an interface for users of an operating system which provides access to the services of a kernel. However, the term is also applied very loosely to applications and may include any software that is "built around" a particular component, such as web...

.

Applications can also be created from the command line or developed with other IDEs. Further debugging options:
  • Wing IDE
    Wing IDE
    The Wing IDE is an integrated development environment for the Python programming language from Wingware.It provides local and remote debugging, editing, code intelligence, testing, version control, and search capabilities to reduce development and debugging time, cut down on coding errors, and...

     allows graphical debugging of web2py applications as you interact with it from your web browser, you can inspect and modify variables, make function calls etc.
  • Eclipse
    Eclipse (software)
    Eclipse is a multi-language software development environment comprising an integrated development environment and an extensible plug-in system...

    /PyDev
    PyDev
    Pydev is a third-party plug-in for Eclipse. It is an Integrated Development Environment used for programming in Python supporting code refactoring, graphical debugging, code analysis and .- History :- Features :...

     — Eclipse with the Aptana PyDev plugin — supports web2py as well.
  • The extensible pdb debugger is a module of Python's standard library.
  • With the platform-independent open-source Winpdb
    Winpdb
    Winpdb is a platform-independent GPL Python debugger with support for multiple threads, namespace modification, embedded debugging, and encrypted communication. According to the , it is up to 20 times faster than Python's built-in debugger pdb. It consists of a graphical front-end based on the...

     debugger, you can perform remote debugging over TCP/IP, through encrypted connection.


The Hello World program with web2py in its simplest form (simple web page with no template) looks like:

def hello:
return 'Hello World'


Web2py includes pure Python-based template language, with no indentation requirements and a server-side Document Object Model (DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

).
The template system works without web2py. Joomla 1.x templates can be converted to web2py layouts.

Web2py also includes the markdown2 text-to-HTML filter, which converts Markdown
Markdown
Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML "...

 markup to HTML on the fly
On the fly
-Colloquial usage:In colloquial use, on the fly means something created when needed. The phrase is used to mean:# something that was not planned ahead# changes that are made during the execution of same activity: ex tempore, impromptu.-Automotive usage:...

.

A controller without a view automatically uses a generic view that render the variables returned by the controller, enabling the development of an application's business logic before writing HTML. The "Hello World" example using a default template:

def hello:
return dict(greeting='Hello World')

Ticketing system

Each web2py application comes with a ticketing system
Issue tracking system
An issue tracking system is a computer software package that manages and maintains lists of issues, as needed by an organization...

:
  • If an error occurs, it is logged and a ticket is issued to the user. That allows error tracking.
  • 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.

Portable cron

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:
  • Soft cron: cron
    Cron
    Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs to run periodically at certain times or dates...

     routines are checked after web page content has been served, does not guarantee execution precision. For unprivileged Apache CGI/WSGI installs.
  • Hard cron: a cron thread
    Thread (computer science)
    In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

     gets started on web2py startup. For Windows and Rocket/standalone web2py installs.
  • 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.

Bytecode distribution

Web2py can compile web applications for distribution in bytecode
Bytecode
Bytecode, also known as p-code , is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software interpreter as well as being suitable for further compilation into machine code...

 compiled form, without source code.

Global environment

Web2py enforces the loading of a global
Global variable
In computer programming, a global variable is a variable that is accessible in every scope . Interaction mechanisms with global variables are called global environment mechanisms...

 environment into model and controller scripts, with the stated aim being that the developer does not have to write import statements for components in that environment, which initially speeds development. This environment will also pick up everything defined in application code files within the folders models/ or controllers/ (which are where application code must live).

However this behaviour means that:
  • There is a greater chance of naming conflicts due to the large number of names, for example if an attribute URL exists on a object, it is easy to refer to Web2py's global URL (instead of self.URL) in a method. The global URL will be used instead without complaint by the python interpreter, causing silent failures.
  • Likewise, it is easy to accidentally overwrite a definition by defining something with the same name in a different application code file. Although this is possible within a single file in ordinary python, it isn't a problem between files, thus Web2py's global mechanism introduces arbitrary coupling between unrelated files. For example, a controller might define a class URL, which would then clobber Web2py's URL.
  • The order of importing these application code files (alphabetically, by name) becomes significant, which may make reasoning about the code more difficult compared to explicit imports,
  • Discovering where a component has been defined becomes more difficult, as there are no explicit imports, i.e. the developer must resort to searching for the original import or definition. Tools (including the built-in inspect module) and IDEs that are able to track definitions will no longer be able to do so without special support for Web2py.
  • Standard python tools become difficult to use, for example unit testing becomes very problematic as the Web2py global environment has to be injected by the test runner into all code being tested.
  • It is hard to move code in those scripts elsewhere as they become dependant on the global environment.


In essence, code in models/ and controllers/ can be viewed as one huge file split into many smaller files, importing from Web2py's own global environment.

Operating systems, Python versions & implementations, virtual machines, hardwares

web2py runs on Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, Windows CE
Windows CE
Microsoft Windows CE is an operating system developed by Microsoft for embedded systems. Windows CE is a distinct operating system and kernel, rather than a trimmed-down version of desktop Windows...

 phones, Mac
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...

, Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

/Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, Google App Engine
Google App Engine
Google App Engine is a platform as a service cloud computing platform for developing and hosting web applications in Google-managed data centers. It virtualizes applications across multiple servers,...

, Amazon EC2, and almost any web hosting via Python 2.4/2.5/2.6/2.7.

Release versions of web2py include Python 2.5, but the source version can be run on 2.4 through 2.7.

web2py since v1.64.0 runs unmodified on Java with Jython
Jython
Jython, successor of JPython, is an implementation of the Python programming language written in Java.-Overview:Jython programs can seamlessly import and use any Java class. Except for some standard modules, Jython programs use Java classes instead of Python modules...

 2.5, without any known limitation.

web2py code can run with IronPython
IronPython
IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. Thereafter, it was maintained by a small team at Microsoft until...

 on .NET
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

. Limitations:
  • no csv module (so no database I/O);
  • no third party database drivers (not even SQLite
    SQLite
    SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...

    , so no databases at all);
  • no built-in web server (unless you cripple it by removing signals and logging).


The web2py binary will run from a USB drive
USB flash drive
A flash drive is a data storage device that consists of flash memory with an integrated Universal Serial Bus interface. flash drives are typically removable and rewritable, and physically much smaller than a floppy disk. Most weigh less than 30 g...

 or a portable hard drive without dependencies, like Portable Python.

Web servers

Web2py can service requests via HTTP and HTTPS
Https
Hypertext Transfer Protocol Secure is a combination of the Hypertext Transfer Protocol with SSL/TLS protocol to provide encrypted communication and secure identification of a network web server...

 with its built-in Rocket server, with Apache
Apache HTTP Server
The Apache HTTP Server, commonly referred to as Apache , is web server software notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million website milestone...

, Lighttpd
Lighttpd
lighttpd is an open-source web server more optimized for speed-critical environments than common products while remaining standards-compliant, secure and flexible...

, Cherokee, Nginx
Nginx
nginx is a Web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. It is licensed under a BSD-like license and it runs on Unix, Linux, BSD variants, Mac OS X, Solaris, and Microsoft Windows.- Overview...

 and almost any other web server through CGI
Common Gateway Interface
The Common Gateway Interface is a standard method for web servers software to delegate the generation of web pages to executable files...

, FastCGI
FastCGI
FastCGI is a protocol for interfacing interactive programs with a web server. FastCGI is a variation on the earlier Common Gateway Interface ; FastCGI's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing a server to handle more web page...

, WSGI, mod proxy
Mod proxy
mod_proxy is an optional module for the Apache HTTP Server .This module implements a proxy/gateway/cache for Apache. It implements proxying capability for or AJP13 , FTP, CONNECT , HTTP/0.9, HTTP/1.0, and HTTP/1.1...

, and/or mod python
Mod python
mod_python is an Apache HTTP Server module that integrates the Python programming language into the Apache server. It is intended to replace Common Gateway Interface as a method of executing Python scripts on a web server. The promised benefits are faster execution speed and maintaining data over...

.

Database handling

The database abstraction layer (DAL
Data access layer
A data access layer is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database....

) 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).

SQLite
SQLite
SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...

 is included in Python and is the default web2py database. A connection string change allows connection to Firebird
Firebird (database server)
Firebird is an open source SQL relational database management system that runs on Linux, Windows, and a variety of Unix. The database forked from Borland's open source edition of InterBase in 2000, but since Firebird 1.5 the code has been largely rewritten ....

, IBM DB2
IBM DB2
The IBM DB2 Enterprise Server Edition is a relational model database server developed by IBM. It primarily runs on Unix , Linux, IBM i , z/OS and Windows servers. DB2 also powers the different IBM InfoSphere Warehouse editions...

, Informix
Informix
IBM Informix is a family of relational database management system developed by IBM. It is positioned as IBM's flagship data server for online transaction processing as well as integrated solutions...

, Ingres, Microsoft SQL Server
Microsoft SQL Server
Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...

, MySQL
MySQL
MySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My...

, Oracle
Oracle Database
The Oracle Database is an object-relational database management system produced and marketed by Oracle Corporation....

, PostgreSQL
PostgreSQL
PostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...

, and Google App Engine
Google App Engine
Google App Engine is a platform as a service cloud computing platform for developing and hosting web applications in Google-managed data centers. It virtualizes applications across multiple servers,...

 (GAE) with some caveats. Specialities:
  • Multiple database connections.
  • Automatic table creates and alters.
  • Automatic transaction
    Database transaction
    A transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...

    s.
  • Distributed transaction
    Distributed transaction
    A distributed transaction is an operations bundle, in which two or more network hosts are involved. Usually, hosts provide transactional resources, while the transaction manager is responsible for creating and managing a global transaction that encompasses all operations against such resources...

    s:
    • Since web2py v1.17 with PostgreSQL v8.2 and later, because it provides API for two-phase commit
      Two-phase commit protocol
      In transaction processing, databases, and computer networking, the two-phase commit protocol is a type of atomic commitment protocol . It is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction on whether to commit or abort the transaction...

      s.
    • Since web2py v1.70.1 with Firebird and MySQL (experimental).
  • GAE is not a relational store, but web2py emulates certain operations.


The DAL is fast, at least comparable with SQLAlchemy
SQLAlchemy
SQLAlchemy is an open source SQL toolkit and object-relational mapper for the Python programming language released under the MIT License.SQLAlchemy provides "a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a...

 and Storm
Storm (software)
In computer software, Storm is a Python object-relational mapper between a SQL database and Python objects. It has been developed at Canonical Ltd...

.

Web2py implements a DAL, not an ORM
Object-relational mapping
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language...

. An ORM map
Data mapping
Data mapping is the process of creating data element mappings between two distinct data models. Data mapping is used as a first step for a wide variety of data integration tasks including:...

s database tables into class
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

es representing logical abstractions from the database layer (e.g., a User class or a PurchaseOrder class), and maps records into instance
Object (computer science)
In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure...

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 to an ORM but it is faster, and can map almost any SQL expressions into DAL expressions. The DAL can be used independent of the rest of web2py.

Automatic database migrations

web2py supports database migration
Data migration
Data migration is the process of transferring data between storage types, formats, or computer systems. Data migration is usually performed programmatically to achieve an automated migration, freeing up human resources from tedious tasks...

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.

Limitations:
  • SQLite does not understand migrations well. In particular it can't alter table and change a column type, but rather simply stores new values according to the new type.
  • GAE has no concept of alter-table, so migrations are limited.

Licenses

Web2py code is released under GNU Lesser General Public License (LGPL) version 3 as of web2py version 1.91.1.

Web2py code before version 1.91.1 was released under GNU GPL v2.0 with commercial exception.

Various third-party packages distributed with web2py have their own licenses, generally MIT or BSD-type licenses. Applications built with web2py are not covered by the LGPL license.

Web2py is copyrighted by Massimo DiPierro. The web2py trademark is owned by Massimo DiPierro.

web2py Book

The base web2py documentation is The Official web2py Book, by Massimo DiPierro. The manual is also available in printed form or as a read-only PDF.
  • 1st Edition: out of print
    Out of print
    Out of print refers to an item, typically a book , but can include any print or visual media or sound recording, that is in the state of no longer being published....

    . Wiley
    John Wiley & Sons
    John Wiley & Sons, Inc., also referred to as Wiley, is a global publishing company that specializes in academic publishing and markets its products to professionals and consumers, students and instructors in higher education, and researchers and practitioners in scientific, technical, medical, and...

    ; September 16, 2008; 256 pages; ISBN 978-0-470-43232-7.
  • 2nd Edition: web2py Manual. Wiley; August 26, 2009; 341 pages; ISBN 978-0-470-59235-9. Read it online. Errata for the book.
  • 3rd Edition: LuLu; September 25, 2010 357 pages; Read it online.

Online documentation

Online documentation is linked from the web2py home page, with cookbook, videos, interactive examples, interactive API reference, epydoc
Epydoc
Epydoc is a documentation generator that processes its own lightweight markup language Epytext for Python documentation strings. As opposed to freeform Python docstrings, reStructured Text and other markup languages for docstrings, Epytext supports linking between different pieces of...

s (complete library reference), FAQ
FAQ
Frequently asked questions are listed questions and answers, all supposed to be commonly asked in some context, and pertaining to a particular topic. "FAQ" is usually pronounced as an initialism rather than an acronym, but an acronym form does exist. Since the acronym FAQ originated in textual...

, cheat sheet, online tools etc.

Videos


Printed

  • Web programming with web2py; Python Magazine; Marco Tabini & Associates, Inc.; June 2008

Support

Community support is available through the web2py knowledge base, the web2py mailing list at Google Groups, and the #web2py channel on freenode
Freenode
freenode, formerly known as Open Projects Network, is an IRC network used to discuss peer-directed projects. Their servers are all accessible from the domain name [irc://chat.freenode.net chat.freenode.net], which load balances connections by using the actual servers in rotation...

. As of 2009-10-02, commercial web2py support is provided by fifteen companies worldwide.

Developers

The lead developer of web2py is Massimo DiPierro, an associate professor of Computer Science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

 at DePaul University
DePaul University
DePaul University is a private institution of higher education and research in Chicago, Illinois. Founded by the Vincentians in 1898, the university takes its name from the 17th century French priest Saint Vincent de Paul...

 in Chicago
Chicago
Chicago is the largest city in the US state of Illinois. With nearly 2.7 million residents, it is the most populous city in the Midwestern United States and the third most populous in the US, after New York City and Los Angeles...

. As of 2011, the web2py homepage lists over 70 "main contributors".

Development source code

The web2py development source code is available from two repositories:
  • Bazaar on Launchpad
    Launchpad (website)
    Launchpad is a web application and website that allow users to develop and maintain software, particularly free software. Launchpad is developed and maintained by Canonical Ltd....

    : BZR snapshot
  • Mercurial
    Mercurial
    Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C. It is supported on Windows and Unix-like systems, such as FreeBSD, Mac OS X and Linux...

     on Google Code
    Google Code
    Google Code is Google's site for developer tools, APIs and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products....

    : hg snapshot

Third-party software included in web2py

  • Python-based components
    Component-based software engineering
    Component-based software engineering is a branch of software engineering that emphasizes the separation of concerns in respect of the wide-ranging functionality available throughout a given software system...

    :
    • Rocket, a fast, HTTP/1.1-compliant, multi-threaded
      Thread (computer science)
      In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

      , SSL
      Transport Layer Security
      Transport Layer Security and its predecessor, Secure Sockets Layer , are cryptographic protocols that provide communication security over the Internet...

      -enabled and streaming
      Streaming media
      Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming provider.The term "presented" is used in this article in a general sense that includes audio or video playback. The name refers to the delivery method of the medium rather...

      -capable WSGI server;
    • fcgi.py: a FastCGI
      FastCGI
      FastCGI is a protocol for interfacing interactive programs with a web server. FastCGI is a variation on the earlier Common Gateway Interface ; FastCGI's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing a server to handle more web page...

      /WSGI gateway
      Gateway (computer program)
      A gateway is a link between two computer programs or systems such as Internet Forums. A gateway acts as a portal between two programs allowing them to share information by communicating between protocols on a computer or between dissimilar computers....

      ;
    • simplejson: a simple, fast, complete, correct and extensible JSON
      JSON
      JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

       encoder and decoder;
    • markdown2: a Markdown
      Markdown
      Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML "...

       processor;
    • PyRTF: an RTF
      Rich Text Format
      The Rich Text Format is a proprietary document file format with published specification developed by Microsoft Corporation since 1987 for Microsoft products and for cross-platform document interchange....

       document generator;
    • a syntax highlighter;
    • PyRSS2Gen: an RSS
      RSS
      -Mathematics:* Root-sum-square, the square root of the sum of the squares of the elements of a data set* Residual sum of squares in statistics-Technology:* RSS , "Really Simple Syndication" or "Rich Site Summary", a family of web feed formats...

       generator;
    • feedparser: to parse RSS and Atom
      Atom (standard)
      The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol is a simple HTTP-based protocol for creating and updating web resources.Web feeds allow software programs to check for updates published on a...

       feeds.
  • JavaScript
    JavaScript
    JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

    -based components:
    • jQuery
      JQuery
      jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML. It was released in January 2006 at BarCamp NYC by John Resig...

      : a lightweight JavaScript library
      JavaScript library
      A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies....

      ;
    • EditArea: a free editor for source code;
    • nicEdit: a lightweight, cross-platform
      Cross-platform
      In computing, cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms...

      , inline content editor.
  • C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

    -based components:
    • SQLite
      SQLite
      SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...

      : a relational database
      Relational database
      A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

      ;
    • memcached
      Memcached
      In computing, memcached is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the...

      : a general-purpose distributed memory caching system.

History and naming

The source code for the first public version of web2py was released under GNU GPL v2.0 on 2007-09-27 by Massimo DiPierro as the Enterprise Web Framework (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.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK