Django web framework
Encyclopedia
Django 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...

, written in 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...

, which follows the model-view-controller 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...

. It was originally developed to manage several news-oriented sites for The World Company
Lawrence Journal-World
The Lawrence Journal-World is a daily newspaper published in Lawrence, Kansas by The World Company.-History:Though the Journal-World title only came into existence in 1911, according to the volume number of the current masthead of the paper, the paper dates itself back to 1858.The Simons family...

 of Lawrence, Kansas
Lawrence, Kansas
Lawrence is the sixth largest city in the U.S. State of Kansas and the county seat of Douglas County. Located in northeastern Kansas, Lawrence is the anchor city of the Lawrence, Kansas, Metropolitan Statistical Area, which encompasses all of Douglas County...

, and was released publicly under a BSD license in July 2005; the framework was named after guitarist Django Reinhardt
Django Reinhardt
Django Reinhardt was a pioneering virtuoso jazz guitarist and composer who invented an entirely new style of jazz guitar technique that has since become a living musical tradition within French gypsy culture...

. In June 2008 it was announced that a newly formed Django Software Foundation will take care of Django in the future.

Django's primary goal is to ease the creation of complex, database-driven websites. Django emphasizes reusability and "pluggability" of components, rapid development, and the principle of DRY (Don't Repeat Yourself)
Don't repeat yourself
In software engineering, Don't Repeat Yourself is a principle of software development aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures...

. Python is used throughout, even for settings, files, and data models.

Django also provides an optional administrative CRUD (create, read, update and delete) interface that is generated dynamically through introspection and configured via admin models.

Components

The core Django MVC
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...

 framework consists of an object-relational mapper
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...

 which mediates between data models
Data modeling
Data modeling in software engineering is the process of creating a data model for an information system by applying formal data modeling techniques.- Overview :...

 (defined as Python classes) and 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...

 ("Model"); a system for processing requests with a web templating system
Web template system
A Web template system describes the software and methodologies used to produce web pages and for deployment on websites and delivery over the Internet. Such systems process web templates, using a template engine...

 ("View") and a regular-expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...

-based URL
Uniform Resource Locator
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....

 dispatcher ("Controller").

Also included in the core framework are:
  • A lightweight, standalone web server for development and testing.
  • A form serialization and validation system which can translate between HTML
    HTML
    HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....

     forms and values suitable for storage in the database.
  • A caching
    Web cache
    A web cache is a mechanism for the temporary storage of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag...

     framework which can use any of several cache methods.
  • Support for middleware
    Middleware
    Middleware is computer software that connects software components or people and their applications. The software consists of a set of services that allows multiple processes running on one or more machines to interact...

     classes which can intervene at various stages of request processing and carry out custom functions.
  • An internal dispatcher system which allows components of an application to communicate events to each other via pre-defined signals.
  • An 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...

     system, including translations of Django's own components into a variety of languages.
  • A serialization
    Serialization
    In computer science, in the context of data storage and transmission, serialization is the process of converting a data structure or object state into a format that can be stored and "resurrected" later in the same or another computer environment...

     system which can produce and read 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....

     and/or 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...

     representations of Django model instances.
  • A system for extending the capabilities of the template engine.
  • An interface to Python's built-in unit test
    Unit test
    In computer programming, unit testing is a method by which individual units of source code are tested to determine if they are fit for use.A unit is the smallest testable part of an application. In procedural programming a unit could be an entire module but is more commonly an individual function...

     framework.

Bundled applications

The main Django distribution also bundles a number of applications in its "contrib" package, including:
  • An extensible authentication system.
  • The dynamic administrative interface.
  • Tools for generating RSS
    RSS (file format)
    RSS is a family of web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format...

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

     syndication feeds.
  • A flexible commenting system.
  • A sites framework that allows one Django installation to run multiple websites, each with their own content and applications.
  • Tools for generating Google Sitemaps
    Google Sitemaps
    The Sitemaps protocol allows a webmaster to inform search engines about URLs on a website that are available for crawling. A Sitemap is an XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes,...

    .
  • Tools for preventing cross-site request forgery
    Cross-site request forgery
    Cross-site request forgery, also known as a one-click attack or session riding and abbreviated as CSRF or XSRF, is a type of malicious exploit of a website whereby unauthorized commands are transmitted from a user that the website trusts...

    .
  • Template libraries which enable the use of lightweight markup language
    Lightweight markup language
    A lightweight markup language is a markup language with a simple syntax, designed to be easy for a human to enter with a simple text editor, and easy to read in its raw form....

    s such as Textile
    Textile (markup language)
    Textile is a lightweight markup language originally developed by Dean Allen and billed as a "humane Web text generator". Textile converts its marked-up text input to valid, well-formed XHTML and also inserts character entity references for apostrophes, opening and closing single and double...

     and 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 "...

    .
  • A framework for creating GIS
    Geographic Information System
    A geographic information system, geographical information science, or geospatial information studies is a system designed to capture, store, manipulate, analyze, manage, and present all types of geographically referenced data...

     applications.

Applications built on Django

  • django CMS
    Django-cms
    django CMS is a free and open sourcecontent management system platform for publishing content on the World Wide Web and intranets. It is based on Django, and written in Python.-History:...

    , a free and open source
    Free and open source software
    Free and open-source software or free/libre/open-source software is software that is liberally licensed to grant users the right to use, study, change, and improve its design through the availability of its source code...

     content management system
    Content management system
    A content management system is a system providing a collection of procedures used to manage work flow in a collaborative environment. These procedures can be manual or computer-based...

     platform for publishing content on the World Wide Web
    World Wide Web
    The World Wide Web is a system of interlinked hypertext documents accessed via the Internet...

     and intranet
    Intranet
    An intranet is a computer network that uses Internet Protocol technology to securely share any part of an organization's information or network operating system within that organization. The term is used in contrast to internet, a network between organizations, and instead refers to a network...

    s. , and written in 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...

    .
  • The Pinax
    Pinax (software)
    Pinax is an open source platform for rapidly developing websites, based on the Django web application framework, written in Python.It came out of an effort to further the use of reusable apps, to make a more accessible bundle of the many components already available for Django, and enabling rapid...

     framework provides reusable applications aimed at Django-based social networking websites.
  • RapidSMS
    RapidSMS
    RapidSMS is a web framework based on the Django web framework which extends the logic and capabilities of Django to communicate with SMS messages. Initial development was funded by UNICEF for use in mobile data collection and polls. A side effect of the work was pygsm, a Python library for...

     is a framework for SMS
    SMS
    SMS is a form of text messaging communication on phones and mobile phones. The terms SMS or sms may also refer to:- Computer hardware :...

     applications built on Django.
  • Pootle
    Pootle
    Pootle is an online translation management tool with translation interface. It is written in the Python programming language using the Django framework and is free software originally developed and released by Translate.org.za in 2004...

     is an online translation management tool.
  • Review Board
    Review Board
    Review Board is a web-based collaborative code review tool, available as free software under the MIT License.An alternative to Rietveld and Gerrit, Review Board integrates with Bazaar, ClearCase, CVS, Git, Mercurial, Perforce, and Subversion....

     is a web-based code review tool.
  • Rietveld
    Rietveld (Software)
    Rietveld is a web-based collaborative code review tool for Subversion written by Guido van Rossum to run on Google's cloud service. Guido based Rietveld on the experience he had writing Mondrian. Mondrian is a proprietary application used internally by Google to review their code.Gerrit is a fork...

     is another web-based code review tool built on Django. It was originally written to serve as a showcase for using Django with Google App Engine.
  • Disqus
    Disqus
    Disqus is an online discussion and commenting service for websites and online communities that uses a networked platform. The company’s platform includes various features, such as social integration, social networking, user profiles, spam and moderation tools, analytics, email notifications, and...

     uses Django for their widely popular discussion platform.
  • Spotify
    Spotify
    Spotify is a Swedish-founded, UK-headquartered DRM-based music streaming service offering streaming of selected music from a range of major and independent record labels, including Sony, EMI, Warner Music Group, and Universal. Launched in October 2008 by Swedish startup Spotify AB, the service had...

     uses Django for some of their web sites.
  • Yandex
    Yandex
    Yandex is a Russian IT company which operates the largest search engine in Russia and develops a number of Internet-based services and products. Yandex is ranked as 5-th world largest search engine...

     uses Django for their weather forecast site, OpenID provider, blog hosting service, internal Wiki and internal Mail Archives.
  • Transifex
    Transifex
    Transifex is an open source platform for localization. It is a service offering users with an easy-to-use interface to submit translations to various projects hosted on a number of hosting platform types. The name literally means "translation-builder" .-Features:Transifex supports translating...

     – an open source platform for localization
    Localization
    Localization or localisation, and represented as a numeronym as L10n, may refer to:* Language localization, the process of translating a product into different languages or adapting a product for a specific country or region...

    .
  • Bucketlist – uses Django to let users store life goals.
  • The Public Broadcasting Service
    Public Broadcasting Service
    The Public Broadcasting Service is an American non-profit public broadcasting television network with 354 member TV stations in the United States which hold collective ownership. Its headquarters is in Arlington, Virginia....

     in the United States uses Django for some of their web sites.
  • The Berkeley Graduate School of Journalism uses Django for their websites.
  • The Faculty of Electrical Engineering and Information Sciences at the Ruhr University Bochum uses Django for their website.
  • Universal Subtitles uses Django for its free and open source collaborative subtitling site.
  • FreeNAS
    FreeNAS
    FreeNAS is a free network-attached storage server, supporting: CIFS , FTP, NFS, rsync, AFP protocols, iSCSI, S.M.A.R.T., local user authentication, and software RAID , with a web-based configuration interface. FreeNAS takes less than 64 MB once installed on CompactFlash, hard drive or USB flash...

     uses Django for its web interface in its newest major release, 8.0.
  • DjangoSites.org uses Django for handling its Django-powered sites directory.

Server arrangements

Django can be run in conjunction 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...

 using mod wsgi
Mod wsgi
mod_wsgi is an Apache HTTP Server module by Graham Dumpleton that provides a WSGI compliant interface for hosting Python 2.3+ based web applications under Apache. As of version 3.0, mod_wsgi supports Python 2.6 and 3.1...

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

. Django also includes the ability to launch 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...

 server, enabling use behind any web server which supports FastCGI. Another deployment option is 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 uwsgi. It should also be possible to use other WSGI-compliant web servers. Django officially supports four database backends: 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...

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

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

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

. MS SQL backend can be used with django-mssql but only in Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 operating systems, similarly external backends exist for IBM DB2 , SQL Anywhere and Firebird. There is a fork
Fork (software development)
In software engineering, a project fork happens when developers take a legal copy of source code from one software package and start independent development on it, creating a distinct piece of software...

 named django-nonrel which supports NoSQL databases like MongoDB
MongoDB
MongoDB is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language...

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

's Datastore.

Django may also be run in conjunction 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...

 on any Java EE application server such as GlassFish
GlassFish
GlassFish is an open source application server project started by Sun Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server...

 or JBoss
JBoss
JBoss Application Server is an open-source Java EE-based application server. An important distinction for this class of software is that it not only implements a server that runs on Java, but it actually implements the Java EE part of Java...

. In this case django-jython must be installed in order to provide JDBC drivers for database connectivity, which also provides functionality to compile Django in to a .war suitable for deployment.

Versions of Django prior to 1.0 had multithreading
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...

 issues and it would be recommended that those versions of Django only be used in a single threaded server configuration, such as with Apache prefork MPM using mod_python or embedded mode of mod_wsgi. Although Django 1.0 is principally believed to now be thread safe, some minor threading issues are still occasionally being found; it may be prudent to continue to use a single threaded server configuration and/or stay current with Django releases and notices about the multithreading issues.

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

 includes Django 0.96.1 as one of the bundled frameworks.

Integrated development environments

While a number of Django developers use text editors such as VIM, Emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

 or TextMate
TextMate
TextMate is a general-purpose GUI text editor for Mac OS X created by Allan Odgaard. Popular with programmers, some notable features include declarative customizations, tabs for open documents, recordable macros, folding sections and snippets, shell integration, and an extensible bundle...

 with Django Bundle for their projects, the other prefer more specialized tools providing intellisense, code completion, debugging, refactoring, unit testing, etc.
  • Eclipse with 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 :...

  • PyCharm
    PyCharm
    PyCharm is an Integrated Development Environment used for programming in Python. It provides code analysis, graphical debugger, integrated unit tester, VCS/DVCS integration and supports web development with Django...

  • NetBeans
    NetBeans
    NetBeans refers to both a platform framework for Java desktop applications, and an integrated development environment for developing with Java, JavaScript, PHP, Python, Groovy, C, C++, Scala, Clojure, and others...

     with Django Plugin
  • 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...

  • Eric Python IDE
    Eric Python IDE
    Eric is a free integrated development environment for the Python and Ruby programming languages. Eric4 is the variant for Python 2 and eric5 is the one for Python 3....


DjangoCon

There is a twice-yearly conference for Django developers and users, named "DjangoCon", that has been held since September 2008. One DjangoCon a year is held in Europe, in May or June; while the other is held in the United States in September, usually in Portland, Oregon
Portland, Oregon
Portland is a city located in the Pacific Northwest, near the confluence of the Willamette and Columbia rivers in the U.S. state of Oregon. As of the 2010 Census, it had a population of 583,776, making it the 29th most populous city in the United States...

..

Books

  • The Definitive Guide to Django (Apress
    Apress
    Apress, Inc. is a publisher of information technology books, based in New York City. It is a division of Springer Science+Business Media.Apress was founded by authors Gary Cornell and Dan Appleman. Its original name was Author's Press, shortened to APress, then Apress. In 2003, Apress purchased...

    ) - first edition December 2007, second edition July 2009. Released under the GNU Free Documentation License
    GNU Free Documentation License
    The GNU Free Documentation License is a copyleft license for free documentation, designed by the Free Software Foundation for the GNU Project. It is similar to the GNU General Public License, giving readers the rights to copy, redistribute, and modify a work and requires all copies and...

    . Available online for free at www.djangobook.com.
  • Practical Django Projects by James Bennett (Apress) - first edition June 2008, second edition June 2009.
  • Pro Django by Marty Alchin (Apress) - December 2008.
  • Python Web Development with Django by Jeff Forcier, Wesley Chun, and Paul Bissex (Addison-Wesley
    Addison-Wesley
    Addison-Wesley was a book publisher in Boston, Massachusetts, best known for its textbooks and computer literature. As well as publishing books, Addison-Wesley also distributed its technical titles through the Safari Books Online e-reference service...

    ) - November 2008.

External links

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