Web2py is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
web application framework
A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
written in the
Python programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
. Web2py allows
web developers
A web developer is a programmer who develops World Wide Web applications using a client–server model. The applications typically use HTML, CSS, and JavaScript in the client, and any general-purpose programming language in the server. is used ...
to program
dynamic web content using
Python. Web2py is designed to help reduce tedious web development tasks, such as developing
web form
A webform, web form or HTML form on a web page allows a user to enter data that is sent to a Server (computing), server for processing. Forms can resemble form (document), paper or database forms because web users fill out the forms using checkboxe ...
s from scratch, although a web developer may build a
form
Form is the shape, visual appearance, or configuration of an object. In a wider sense, the form is the way something happens.
Form also refers to:
* Form (document), a document (printed or electronic) with spaces in which to write or enter dat ...
from scratch if required.
Web2py was originally designed as a teaching tool with emphasis on ease of use and
deployment
Deployment may refer to:
Engineering and software Concepts
* Blue-green deployment, a method of installing changes to a web, app, or database server by swapping alternating production and staging servers
* Continuous deployment, a software e ...
. Therefore, it does not have any project-level configuration files. The design of web2py was inspired by the
Ruby on Rails
Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web ...
and
Django
Django may refer to:
Arts and entertainment Film
* ''Django'' (1966 film), a 1966 Italian Western by Sergio Corbucci which had a particular influence on the Spaghetti Western genre and a number of unofficial prequels and sequels
** ''Django, Prep ...
frameworks. Like these frameworks, web2py focuses on
rapid development, favors
convention over configuration
Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necess ...
approach and follows a
model–view–controller
Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements. This is done to separate internal representations of infor ...
(MVC)
architectural pattern
An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. The architectural patterns address various issues in software engineering, such as computer hardware perfor ...
.
Overview
Web2py is a
full-stack framework
Full stack, full-stack, fullstack or Full Stack Cloud might refer to;
* Full Stack Cloud are those complete Cloud Computing, provided by Cloud Service Provider in the form of integrated software technologies, with or without hardware.
Type a Full ...
in that it has built-in components for all major functions, including:
*
HTTP
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
requests, HTTP responses,
cookies
A cookie is a baked or cooked snack or dessert that is typically small, flat and sweet. It usually contains flour, sugar, egg, and some type of oil, fat, or butter. It may include other ingredients such as raisins, oats, chocolate chips, n ...
,
sessions
Sessions may refer to:
* Sessions (surname), a surname
* Sessions (clothing company), an American apparel company
* Sessions Clock Company, an American clock manufacturer in the early 20th century
Arts, entertainment, and media
* ''The Sessions' ...
;
* multiple protocols
HTML
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
/
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. ...
,
REST
Rest or REST may refer to:
Relief from activity
* Sleep
** Bed rest
* Kneeling
* Lying (position)
* Sitting
* Squatting position
Structural support
* Structural support
** Rest (cue sports)
** Armrest
** Headrest
** Footrest
Arts and ente ...
,
ATOM
Every atom is composed of a nucleus and one or more electrons bound to the nucleus. The nucleus is made of one or more protons and a number of neutrons. Only the most common variety of hydrogen has no neutrons.
Every solid, liquid, gas ...
and
RSS
RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
,
RTF
RTF may refer to:
Organisations
* African Union Regional Task Force, the military operation of the RCI-LRA, 2011–2018.
* Radiodiffusion-Télévision Française, a broadcaster in France, 1949–1964
* Russian Tennis Federation, the national go ...
and
CSV,
JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other s ...
,
JSON-RPC
JSON-RPC is a remote procedure call protocol encoded in JSON. It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for ...
and
XML-RPC
XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.Simon St. Laurent, Joe Johnston, Edd Dumbill. (June 2001) ''Programming Web Services with XML-RPC.'' O'Reilly. First Editi ...
,
AMF-RPC (
Flash
Flash, flashes, or FLASH may refer to:
Arts, entertainment, and media
Fictional aliases
* Flash (DC Comics character), several DC Comics superheroes with super speed:
** Flash (Barry Allen)
** Flash (Jay Garrick)
** Wally West, the first Kid F ...
/
Flex
Flex or FLEX may refer to:
Computing
* Flex (language), developed by Alan Kay
* FLEX (operating system), a single-tasking operating system for the Motorola 6800
* FlexOS, an operating system developed by Digital Research
* FLEX (protocol), a ...
), and
SOAP
Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are surfactants usually used for washing, bathing, and other types of housekeeping. In industrial settings, soaps are used ...
;
*
CRUD
In computer programming, create, read, update, and delete (CRUD) are the four basic operations of persistent storage. CRUD is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing information u ...
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
;
* multiple
authentication
Authentication (from ''authentikos'', "real, genuine", from αὐθέντης ''authentes'', "author") is the act of proving an assertion, such as the identity of a computer system user. In contrast with identification, the act of indicat ...
mechanisms and
role-based access control
In computer systems security, role-based access control (RBAC) or role-based security is an approach to restricting system access to authorized users. It is an approach to implement mandatory access control (MAC) or discretionary access control ...
;
*
database abstraction layer
A database abstraction layer (DBAL or DAL) is an application programming interface which unifies the communication between a computer application and databases such as SQL Server, IBM Db2, MySQL, PostgreSQL, Oracle or SQLite. Traditionally, all ...
(DAL) that dynamically generates
SQL and runs on multiple compatible database backends;
*
RAM
Ram, ram, or RAM may refer to:
Animals
* A male sheep
* Ram cichlid, a freshwater tropical fish
People
* Ram (given name)
* Ram (surname)
* Ram (director) (Ramsubramaniam), an Indian Tamil film director
* RAM (musician) (born 1974), Dutch
...
,
disk, and
memcached
Memcached (pronounced variously ''mem-cash-dee'' or ''mem-cashed'') is a general-purpose distributed memory caching, memory-caching system. It is often used to speed up dynamic database-driven websites by caching data and Object (computer science) ...
-based
caching
In computing, a cache ( ) is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewher ...
for
scalability
Scalability is the property of a system to handle a growing amount of work by adding resources to the system.
In an economic context, a scalable business model implies that a company can increase sales given increased resources. For example, a ...
;
*
internationalization
In economics, internationalization or internationalisation is the process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization. Internationalization is a crucial strateg ...
support;
*
jQuery
jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is ...
for
Ajax
Ajax may refer to:
Greek mythology and tragedy
* Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea
* Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris
* ''Ajax'' (play), by the ancient Gree ...
and
UI effects;
* automatic logging of errors with context.
Web2py encourages sound
software engineering
Software engineering is a systematic engineering approach to software development.
A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term ' ...
practices such as
* the
model–view–controller
Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements. This is done to separate internal representations of infor ...
(MVC) pattern;
* self-submission of
web form
A webform, web form or HTML form on a web page allows a user to enter data that is sent to a Server (computing), server for processing. Forms can resemble form (document), paper or database forms because web users fill out the forms using checkboxe ...
s;
*
server-side
In the client–server model, server-side refers to programs and operations that run on the server. This is in contrast to client-side programs and operations which run on the client.
General concepts
Typically, a server is a computer applicati ...
sessions;
* safe handling of uploaded files.
Web2py uses the
WSGI
The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, ve ...
protocol, the Python-oriented protocol for
communication
Communication (from la, communicare, meaning "to share" or "to be in relation with") is usually defined as the transmission of information. The term may also refer to the message communicated through such transmissions or the field of inqu ...
between
web server
A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initi ...
and web applications. It also provides handlers for
CGI and the
FastCGI
FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI p ...
protocols, and it includes the
multi-threaded
In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. The implementation of threads and processes dif ...
,
SSL SSL may refer to:
Entertainment
* RoboCup Small Size League, robotics football competition
* ''Sesame Street Live'', a touring version of the children's television show
* StarCraft II StarLeague, a Korean league in the video game
Natural language ...
-enabled Rocket wsgiserver.
Distinctive features
Web-based integrated development environment (IDE)
All
development
Development or developing may refer to:
Arts
*Development hell, when a project is stuck in development
*Filmmaking, development phase, including finance and budgeting
*Development (music), the process thematic material is reshaped
*Photographi ...
,
debugging
In computer programming and software development, debugging is the process of finding and resolving ''bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems.
Debugging tactics can involve in ...
,
testing
An examination (exam or evaluation) or test is an educational assessment intended to measure a test-taker's knowledge, skill, aptitude, physical fitness, or classification in many other topics (e.g., beliefs). A test may be administered verba ...
,
maintenance
Maintenance may refer to:
Biological science
* Maintenance of an organism
* Maintenance respiration
Non-technical maintenance
* Alimony, also called ''maintenance'' in British English
* Champerty and maintenance, two related legal doctrine ...
and remote database administration can (optionally) be performed without third-party tools, via a web interface, itself a web2py application.
Internationalization
In economics, internationalization or internationalisation is the process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization. Internationalization is a crucial strateg ...
(adding languages and writing translations) can also be performed from this
IDE. Each application has an automatically generated database administrative interface, similar to
Django
Django may refer to:
Arts and entertainment Film
* ''Django'' (1966 film), a 1966 Italian Western by Sergio Corbucci which had a particular influence on the Spaghetti Western genre and a number of unofficial prequels and sequels
** ''Django, Prep ...
. The web IDE also includes web-based testing.
Applications can also be created from the
command line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
or developed with other IDEs. Further debugging options:
*
Wing IDE
The Wing Python IDE family of integrated development environments (IDEs) from Wingware was created specifically for the Python programming language, with support for editing, testing, debugging, inspecting/browsing, and error checking Python c ...
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
An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
/
PyDev
PyDev is a third-party plug-in for Eclipse. It is an Integrated Development Environment (IDE) used for programming in Python supporting code refactoring, graphical debugging, code analysis among other features.
History
PyDev was originall ...
— 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 debugger, one can perform remote debugging over
TCP/IP
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
, through encrypted connection.
The
Hello World
''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses
''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich ...
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
A template processor (also known as a template engine or template parser) is software designed to combine templates with a data model to produce result documents.
The language that the templates are written in is known as a template language ...
, with no
indentation
__FORCETOC__
In the written form of many languages, an indentation or indent is an empty space at the beginning of a line to signal the start of a new paragraph. Many computer languages have adopted this technique to designate "paragraphs" or ot ...
requirements and a server-side Document Object Model (
DOM).
The template system works without web2py.
Joomla
Joomla (), also spelled Joomla! (with an exclamation mark) and sometimes abbreviated as J!, is a free and open-source content management system (CMS) for publishing web content on websites. Web content applications include discussion forums, p ...
1.x templates can be converted to web2py layouts.
Web2py also includes two markup libraries: the markdown2 text-to-HTML filter, which converts
Markdown
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to human readers in its source code form. Markdown i ...
markup to HTML
on the fly
On the fly is a phrase used to describe something that is being changed while the process that the change affects is ongoing. It is used in the automotive, computer, and culinary industries. In cars, on the fly can be used to describe the changing ...
; and markmin which is inspired by markdown but supports tables, html5 video/audio and oembed protocol.
A
controller
Controller may refer to:
Occupations
* Controller or financial controller, or in government accounting comptroller, a senior accounting position
* Controller, someone who performs agent handling in espionage
* Air traffic controller, a person ...
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')
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.
Here is a more complex code example which defines a table, and exposes a grid to logged in users:
db.define_table('thing',Field('name',notnull=True))
@auth.requires_login()
def hello():
return dict(grid = SQLFORM.grid(db.thing))
Ticketing system
Each web2py application comes with a
ticketing system
An issue tracking system (also ITS, trouble ticket system, support ticket, request management or incident ticket system) is a computer software package that manages and maintains lists of issues. Issue tracking systems are generally used in colla ...
:
* 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
The cron command-line utility is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs (commands or shell scripts), also known as cron jobs, to run periodically at fixed ti ...
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 may refer to:
Objects
* Thread (yarn), a kind of thin yarn used for sewing
** Thread (unit of measurement), a cotton yarn measure
* Screw thread, a helical ridge on a cylindrical fastener
Arts and entertainment
* ''Thread'' (film), 2016 ...
gets started on web2py startup. For Windows and Rocket/standalone web2py installs.
* System cron: cron functions get force-called from the
command line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
, 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.
Scheduler
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.
Bytecode distribution
Web2py can compile web applications for distribution in
bytecode
Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
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.
Global Environment
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.
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.
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.
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.
Supported environments
Operating systems, Python versions & implementations, virtual machines, hardware
web2py runs on
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
,
Windows CE
Windows Embedded Compact, formerly Windows Embedded CE, Windows Powered and Windows CE, is an operating system subfamily developed by Microsoft as part of its Windows Embedded family of products.
Unlike Windows Embedded Standard, which is ba ...
phones,
Mac
Mac or MAC most commonly refers to:
* Mac (computer), a family of personal computers made by Apple Inc.
* Mackintosh, a raincoat made of rubberized cloth
* A variant of the word macaroni, mostly used in the name of the dish mac and cheese
* Mac, ...
,
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
/
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
,
Google App Engine
Google App Engine (often referred to as GAE or simply App Engine) is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers ...
,
Amazon EC2
Amazon Elastic Compute Cloud (EC2) is a part of Amazon.com's cloud-computing platform, Amazon Web Services (AWS), that allows users to rent virtual computers on which to run their own computer applications. EC2 encourages scalable deployment o ...
, and almost any web hosting via Python 2.7/3.5/3.6/pypy.
[
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.
web2py since v1.64.0 runs unmodified on ]Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
with Jython
Jython is an implementation of the Python programming language designed to run on the Java platform. The implementation was formerly known as JPython until 1999.
Overview
Jython programs can import and use any Java class. Except for some stand ...
2.5, without any known limitation.
web2py code can run with 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. IronPython 2.0 ...
on .NET. Limitations:
* no ''csv'' module (so no database I/O);
* no third party database drivers (not even SQLite
SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
, 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
A USB flash drive (also called a thumb drive) is a data storage device that includes flash memory with an integrated USB interface. It is typically removable, rewritable and much smaller than an optical disc. Most weigh less than . Since first ...
or a portable hard drive without dependencies, like Portable Python.
Web servers
Web2py can service requests via HTTP
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
and HTTPS
Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It is used for secure communication over a computer network, and is widely used on the Internet. In HTTPS, the communication protocol is e ...
with its built-in Rocket server, with Apache, Lighttpd
lighttpd (pronounced "lighty") is an open-source web server optimized for speed-critical environments while remaining standards-compliant, secure and flexible. It was originally written by Jan Kneschke as a proof-of-concept of the c10k problem � ...
, Cherokee
The Cherokee (; chr, ᎠᏂᏴᏫᏯᎢ, translit=Aniyvwiyaʔi or Anigiduwagi, or chr, ᏣᎳᎩ, links=no, translit=Tsalagi) are one of the indigenous peoples of the Southeastern Woodlands of the United States. Prior to the 18th century, th ...
, Hiawatha
Hiawatha ( , also : ), also known as Ayenwathaaa or Aiionwatha, was a precolonial Native American leader and co-founder of the Iroquois Confederacy. He was a leader of the Onondaga people, the Mohawk people, or both. According to some accou ...
, Nginx
Nginx (pronounced "engine x" ) is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software ...
and almost any other web server through CGI, FastCGI
FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI p ...
, WSGI
The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, ve ...
, mod_proxy
mod_proxy is an optional module for the Apache HTTP Server.
This module implements a proxy, gateway or cache for Apache. It implements proxying capability for AJP13 (Apache JServ Protocol version 1.3), FTP, CONNECT (for SSL), HTTP/0.9, HTT ...
, and/or mod_python
mod_python is an Apache HTTP Server module that integrates the Python programming language with the server. It is intended to provide a Python language binding for the Apache HTTP Server.
When mod_python released it was one of the more efficient ...
.
IDEs and debuggers
While a number of web2py developers use text editors
A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be u ...
such as Vim
Vim means enthusiasm and vigor. It may also refer to:
* Vim (cleaning product)
* Vim Comedy Company, a movie studio
* Vim Records
* Vimentin, a protein
* "Vim", a song by Machine Head on the album ''Through the Ashes of Empires''
* Vim (text ed ...
, Emacs
Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, ...
or TextMate
TextMate is a general-purpose GUI text editor for macOS created by Allan Odgaard. TextMate features declarative customizations, tabs for open documents, recordable macros, folding sections, snippets, shell integration, and an extensible bun ...
Web2py also has a built-in web-based IDE. Others prefer more specialized tools providing debugging, refactoring, etc.
*Aptana Studio
Aptana, Inc. is a company that makes web application development tools for use with a variety of programming languages (such as JavaScript, Ruby, PHP and Python). Aptana's main products include Aptana Studio, Aptana Cloud and Aptana Jaxer.
Aptan ...
with integrated PyDev
PyDev is a third-party plug-in for Eclipse. It is an Integrated Development Environment (IDE) used for programming in Python supporting code refactoring, graphical debugging, code analysis among other features.
History
PyDev was originall ...
*Eclipse
An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
with PyDev
PyDev is a third-party plug-in for Eclipse. It is an Integrated Development Environment (IDE) used for programming in Python supporting code refactoring, graphical debugging, code analysis among other features.
History
PyDev was originall ...
*Eric
The given name Eric, Erich, Erikk, Erik, Erick, or Eirik is derived from the Old Norse name ''Eiríkr'' (or ''Eríkr'' in Old East Norse due to monophthongization).
The first element, ''ei-'' may be derived from the older Proto-Norse ''* a ...
with built-in debugger.
*Wing IDE
The Wing Python IDE family of integrated development environments (IDEs) from Wingware was created specifically for the Python programming language, with support for editing, testing, debugging, inspecting/browsing, and error checking Python c ...
*Microsoft Visual Studio
Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platfor ...
with Python Tools for Visual Studio
Python Tools for Visual Studio (PTVS) is a free and open-source plug-in for versions of Visual Studio up to VS 2015 providing support for programming in Python. Since VS 2017, it is integrated in VS and called Python Support in Visual Studio. It ...
* Pycharm
PyCharm is an integrated development environment (IDE) used for programming in Python. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and supports web development with Dja ...
3 has Web2py framework support
Database handling
The database abstraction layer (DAL
In Indian cuisine, ''dal'' (also spelled ''daal'' or ''dhal''; pronunciation: , Hindi: दाल, Urdu: ) are dried, split pulses (e.g., lentils, peas, and beans) that do not require soaking before cooking. India is the largest producer of p ...
) 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 (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
is included in Python and is the default web2py database. A connection string change allows connection to Firebird
Firebird and fire bird may refer to:
Mythical birds
* Phoenix (mythology), sacred firebird found in the mythologies of many cultures
* Bennu, Egyptian firebird
* Huma bird, Persian firebird
* Firebird (Slavic folklore)
Bird species
''Various spe ...
, IBM Db2
Db2 is a family of data management products, including database servers, developed by IBM. It initially supported the relational model, but was extended to support object–relational features and non-relational structures like JSON and ...
, Informix
IBM Informix is a product family within IBM's Information Management division that is centered on several relational database management system (RDBMS) offerings. The Informix products were originally developed by Informix Corporation, whose ...
, Ingres
Jean-Auguste-Dominique Ingres ( , ; 29 August 1780 – 14 January 1867) was a French Neoclassical painter. Ingres was profoundly influenced by past artistic traditions and aspired to become the guardian of academic orthodoxy against the a ...
, Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
, MySQL
MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database ...
, Oracle
An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination.
Description
The wor ...
, PostgreSQL
PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the In ...
, and Google App Engine
Google App Engine (often referred to as GAE or simply App Engine) is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers ...
(GAE) with some caveats. Specialities:
* Multiple database connections.
* Automatic table creates and alters.
* Automatic transaction
Transaction or transactional may refer to:
Commerce
*Financial transaction, an agreement, communication, or movement carried out between a buyer and a seller to exchange an asset for payment
*Debits and credits in a Double-entry bookkeeping syst ...
s.
* Distributed transaction A distributed transaction is a database transaction 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 enc ...
s:
** Since web2py v1.17 with PostgreSQL v8.2 and later, because it provides API for two-phase commit
In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). It is a distributed algorithm that coordinates all the processes that participate in a distributed ...
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 is an open-source SQL toolkit and object-relational mapper (ORM) for the Python programming language released under the MIT License.
Description
SQLAlchemy's philosophy is that relational databases behave less like object collectio ...
and Storm
A storm is any disturbed state of the natural environment or the atmosphere of an astronomical body. It may be marked by significant disruptions to normal conditions such as strong wind, tornadoes, hail, thunder and lightning (a thunderstorm), ...
.
Web2py implements a DAL, not an ORM
Orm (in Old Norse and in modern Danish, Swedish, Norwegian ( bokmål and nynorsk) the word for "snake", "worm" or "dragon") became an Anglo-Saxon personal name during period of the Danelaw.
Orm may also refer to:
* Orm or Ormin, the autho ...
. An ORM maps database tables into class
Class or The Class may refer to:
Common uses not otherwise categorized
* Class (biology), a taxonomic rank
* Class (knowledge representation), a collection of individuals or objects
* Class (philosophy), an analytical concept used differently ...
es representing logical abstractions from the database layer (e.g., a User class or a PurchaseOrder class), and maps records into instance
Instantiation or instance may refer to:
Philosophy
* A modern concept similar to ''participation'' in classical Platonism; see the Theory of Forms
* The instantiation principle, the idea that in order for a property to exist, it must be had by ...
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 independently of the rest of web2py.
Here are some examples of DAL syntax:
db = DAL('postgresql://user:pass@localhost/db', pool_size=10)
db.define_table('person',Field('name'),Field('image','upload'))
db.person.insert(name='Martin', image=open('filename.png'))
rows = db((db.person.name'Martin'), db.person.name.contains('T')).select(orderby=db.person.name.lower())
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.
Automatic database migrations
web2py supports database migration
Migration, migratory, or migrate may refer to: Human migration
* Human migration, physical movement by humans from one region to another
** International migration, when peoples cross state boundaries and stay in the host state for some minimum l ...
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 cannot 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
The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
(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 public domain
The public domain (PD) consists of all the creative work to which no exclusive intellectual property rights apply. Those rights may have expired, been forfeited, expressly waived, or may be inapplicable. Because those rights have expired, ...
, MIT
The Massachusetts Institute of Technology (MIT) is a private land-grant research university in Cambridge, Massachusetts. Established in 1861, MIT has played a key role in the development of modern technology and science, and is one of the ...
or BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Be ...
-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
Massimo, also Massimino, and Massimine () is a masculine Italian given name. Notable people with the name include:
Given name:
*Massimo Agostinelli
Massimo Agostinelli (Max Agos) (; born 25 September 1987) is a Swiss based Italian American artist ...
.
Awards
In 2011 InfoWorld
''InfoWorld'' (abbreviated IW) is an information technology media business. Founded in 1978, it began as a monthly magazine. In 2007, it transitioned to a web-only publication. Its parent company today is International Data Group, and its sister ...
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
''InfoWorld'' (abbreviated IW) is an information technology media business. Founded in 1978, it began as a monthly magazine. In 2007, it transitioned to a web-only publication. Its parent company today is International Data Group, and its sister ...
Technology of the Year award.
Publications
web2py Book
The base web2py documentation is The Official web2py Book, by Massimo DiPierro
Massimo, also Massimino, and Massimine () is a masculine Italian given name. Notable people with the name include:
Given name:
*Massimo Agostinelli
Massimo Agostinelli (Max Agos) (; born 25 September 1987) is a Swiss based Italian American artist ...
. The manual is a full web2py application and it's freely available online, in PDF format or printed form.
* 1st Edition: out of print
__NOTOC__
An out-of-print (OOP) or out-of-commerce item or work is something that is no longer being published. The term applies to all types of printed matter, visual media, sound recordings, and video recordings. An out-of-print book is a boo ...
. Wiley
Wiley may refer to:
Locations
* Wiley, Colorado, a U.S. town
* Wiley, Pleasants County, West Virginia, U.S.
* Wiley-Kaserne, a district of the city of Neu-Ulm, Germany
People
* Wiley (musician), British grime MC, rapper, and producer
* Wiley Mi ...
; September 16, 2008; 256 pages; .
* 2nd Edition: web2py Manual. Wiley; August 26, 2009; 341 pages; .
* 3rd Edition: Lulu; September 25, 2010 357 pages.
* 4th Edition: Lulu; December 9, 2011 583 pages.
* 5th Edition: PDF Copy; March 3, 2013 614 pages; .
*latest online sources: on GitHub
Online documentation
Online documentation is linked from the web2py home page, with cookbook
A cookbook or cookery book is a kitchen reference containing recipes.
Cookbooks may be general, or may specialize in a particular cuisine or category of food.
Recipes in cookbooks are organized in various ways: by course (appetizer, first cour ...
, videos, interactive examples, interactive API reference, epydoc s (complete library reference), FAQ, cheat sheet
A cheat sheet (also ''cheatsheet'') or crib sheet is a concise set of notes used for quick reference. Cheat sheets were historically used by students without an instructor or teacher's knowledge to cheat on a test or exam. In the context of hig ...
, online tools etc.
* Cheat sheet for web2py.
* web2pyslices, recipes posted using the movuca social network in web2py.
* Crash Course in Web2py (5-part series).
* Web2py slides (old).
Videos
* ''web2py Enterprise Web Framework Tutorial''.
* ''web2py "Shootout" video tutorial''.
* ''web2py on the Google appengine''.
* ''web2py: Create, edit, and deploy a basic web app''.
Printed
* "web2py application development cookbook", Packt, 2012
* ''Web programming with web2py''; ''Python Magazine''; Marco Tabini & Associates, Inc.; June 2008
Background
Developers
The lead developer of web2py is Massimo DiPierro, an associate professor of Computer Science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
at DePaul University
DePaul University is a private university, private, Catholic higher education, Catholic research university in Chicago, Illinois. Founded by the Congregation of the Mission, Vincentians in 1898, the university takes its name from the 17th-centu ...
in Chicago
(''City in a Garden''); I Will
, image_map =
, map_caption = Interactive Map of Chicago
, coordinates =
, coordinates_footnotes =
, subdivision_type = List of sovereign states, Count ...
. As of 2011, the web2py homepage lists over 70 "main contributors".List of main contributors to web2py
/ref>
Development source code
The web2py development source code is available from the main repository:
* Git
Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integ ...
on GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
: Web2Py
Third-party software included in web2py
* Python-based components
Circuit Component may refer to:
•Are devices that perform functions when they are connected in a circuit.
In engineering, science, and technology Generic systems
* System components, an entity with discrete structure, such as an assem ...
:
** Rocket, a fast, HTTP/1.1-compliant, multi-threaded
In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. The implementation of threads and processes dif ...
, SSL SSL may refer to:
Entertainment
* RoboCup Small Size League, robotics football competition
* ''Sesame Street Live'', a touring version of the children's television show
* StarCraft II StarLeague, a Korean league in the video game
Natural language ...
-enabled and streaming
Streaming media is multimedia that is delivered and consumed in a continuous manner from a source, with little or no intermediate storage in network elements. ''Streaming'' refers to the delivery method of content, rather than the content i ...
-capable WSGI
The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, ve ...
server;
** fcgi.py: a FastCGI
FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI p ...
/WSGI
The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, ve ...
gateway;
** Login API for Janrain, Dropbox, Google, LDAP, PAM, X509, CAS, OpenID, OAuth 1&2, Loginza
** simplejson: a simple, fast, complete, correct and extensible JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other s ...
encoder and decoder;
** markdown2: a Markdown
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to human readers in its source code form. Markdown i ...
processor;
** fpdf a library for PDF generation;
** PyRTF: an RTF
RTF may refer to:
Organisations
* African Union Regional Task Force, the military operation of the RCI-LRA, 2011–2018.
* Radiodiffusion-Télévision Française, a broadcaster in France, 1949–1964
* Russian Tennis Federation, the national go ...
document generator;
** a syntax highlight
Syntax highlighting is a feature of text editors that are used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of term ...
er;
** pysimplesoap for SOAP services;
** PyRSS2Gen: an RSS
RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
generator;
** feedparser: to parse RSS and Atom
Every atom is composed of a nucleus and one or more electrons bound to the nucleus. The nucleus is made of one or more protons and a number of neutrons. Only the most common variety of hydrogen has no neutrons.
Every solid, liquid, gas ...
feeds.
* JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
-based components:
** jQuery
jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is ...
: a lightweight JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies.
Libraries
With the expanded demands for JavaScript, an e ...
;
** CodeMirror
CodeMirror is a JavaScript component that provides a code editor in the browser. It has a rich programming API and a focus on extensibility.
History
The first version of the editor was written early 2007, for the console in the Eloquent JavaS ...
: a free editor for source code;
* C-based components:
** SQLite
SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
: a relational database
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
;
** memcached
Memcached (pronounced variously ''mem-cash-dee'' or ''mem-cashed'') is a general-purpose distributed memory caching, memory-caching system. It is often used to speed up dynamic database-driven websites by caching data and Object (computer science) ...
: a general-purpose distributed memory caching system.
** Payment API for Authorize.Net, Google Wallet, Stripe.com
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
Massimo, also Massimino, and Massimine () is a masculine Italian given name. Notable people with the name include:
Given name:
*Massimo Agostinelli
Massimo Agostinelli (Max Agos) (; born 25 September 1987) is a Swiss based Italian American artist ...
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.
Applications built on Web2py
* Movuca CMS
CMS may refer to:
Computing
* Call management system
* CMS-2 (programming language), used by the United States Navy
* Code Morphing Software, a technology used by Transmeta
* Collection management system for a museum collection
* Color manage ...
and Social Network Engine.
* Instant Press
In physics and the philosophy of science, instant refers to an infinitesimal interval in time, whose passage is instantaneous. In ordinary speech, an instant has been defined as "a point or very short space of time," a notion deriving from its ...
Blog
A blog (a truncation of "weblog") is a discussion or informational website published on the World Wide Web consisting of discrete, often informal diary-style text entries (posts). Posts are typically displayed in reverse chronological order ...
platform.
* Ourway Social networking site.
* NoobMusic A rock music website.
* LinkFindr Network diagnostic tool.
* StarMaker
''Star Maker'' is a science fiction novel by British writer Olaf Stapledon, published in 1937. The book describes a history of life in the universe, dwarfing in scale Stapledon's previous book, ''Last and First Men'' (1930), a history of the hu ...
Develops karaoke-style social music apps.
Notes
External links
*
{{Authority control
Free content management systems
Python (programming language) web frameworks