Django ( ; sometimes stylized as django) is a
free and open-source
Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
,
Python-based
web framework that follows the model–template–views (MTV)
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 perform ...
.
It is maintained by the
Django Software Foundation (DSF), an independent organization established in the US as a
501(c)(3)
A 501(c)(3) organization is a United States corporation, trust, unincorporated association or other type of organization exempt from federal income tax under section 501(c)(3) of Title 26 of the United States Code. It is one of the 29 types of 50 ...
non-profit.
Django's primary goal is to ease the creation of complex, database-driven websites. The framework emphasizes
reusability and "pluggability" of components, less code, low coupling, rapid development, and the principle of
don't repeat yourself
"Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.
The DRY principle is stated as "Every piece o ...
. Python is used throughout, even for settings, files, and data models. Django also provides an optional administrative
create, read, update and delete interface that is generated dynamically through
introspection and configured via admin models.
Some well-known sites that use Django include
Instagram
Instagram is a photo and video sharing social networking service owned by American company Meta Platforms. The app allows users to upload media that can be edited with filters and organized by hashtags and geographical tagging. Posts can ...
,
Mozilla,
Disqus
Disqus () is an American blog comment hosting service for web sites and online communities that use a networked platform. The company's platform includes various features, such as social integration, social networking, user profiles, spam and ...
,
Bitbucket,
Nextdoor and
Clubhouse.
History
Django was created in the fall of 2003, when the
web programmer
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). Web development can range from developing a simple single static page of plain text to complex web applications, ...
s at the ''
Lawrence Journal-World'' newspaper,
Adrian Holovaty and
Simon Willison, began using Python to build applications.
Jacob Kaplan-Moss was hired early in Django's development shortly before Simon Willison's internship ended. It was released publicly under a
BSD license in July 2005. The framework was named after guitarist
Django Reinhardt.
Adrian Holovaty is a Romani jazz guitar player and a big fan of Django Reinhardt.
In June 2008, it was announced that a newly formed
Django Software Foundation (DSF) would maintain Django in the future.
Features
Components

Despite having its own nomenclature, such as naming the callable objects generating the
HTTP responses "views",
the core Django framework can be seen as an
MVC architecture.
It consists of an
object-relational mapper (ORM) that mediates between
data models
A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. For instance, a data model may specify that the data element representing a car be c ...
(defined as Python classes) and 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 ...
("Model"), a system for processing HTTP requests with a
web templating system ("View"), and a
regular-expression-based
URL
A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifie ...
dispatcher ("Controller").
Also included in the core framework are:
* a lightweight and standalone
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, initiate ...
for development and testing
* a form serialization and validation system that can translate between
HTML forms and values suitable for storage in the database
* a template system that utilizes the concept of
inheritance borrowed from object-oriented programming
* a
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 ...
framework that can use any of several cache methods
* support for
middleware classes that can intervene at various stages of request processing and carry out custom functions
* an internal dispatcher system that allows components of an application to communicate events to each other via pre-defined signals
* an
internationalization system, including translations of Django's own components into a variety of languages
* a
serialization
In computing, serialization (or serialisation) is the process of translating a data structure or object state into a format that can be stored (e.g. files in secondary storage devices, data buffers in primary storage devices) or transmitted (e ...
system that can produce and read
XML and/or
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 ser ...
representations of Django model instances
* a system for extending the capabilities of the template engine
* an interface to Python's built-in
unit test 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 ( 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 ...
and
Atom syndication feeds
* a "Sites" framework that allows one Django installation to run multiple websites, each with their own content and applications
* tools for generating
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 eac ...
* built-in mitigation for
cross-site request forgery,
cross-site scripting,
SQL injection,
password cracking
In cryptanalysis and computer security, password cracking is the process of recovering passwords from data that has been stored in or transmitted by a computer system in scrambled form. A common approach (brute-force attack) is to repeatedly try ...
and other typical web attacks, most of them turned on by default
* a framework for creating
GIS
A geographic information system (GIS) is a type of database containing Geographic data and information, geographic data (that is, descriptions of phenomena for which location is relevant), combined with Geographic information system software, sof ...
applications
Extensibility
Django's configuration system allows third party code to be plugged into a regular project, provided that it follows the reusable app conventions. More than 2500 packages are available to extend the framework's original behavior, providing solutions to issues the original tool didn't tackle: registration, search,
API provision and consumption,
CMS, etc.
This extensibility is, however, mitigated by internal components' dependencies. While the Django philosophy implies loose coupling, the template filters and tags assume one engine implementation, and both the auth and admin bundled applications require the use of the internal
ORM. None of these filters or bundled apps are mandatory to run a Django project, but reusable apps tend to depend on them, encouraging developers to keep using the official stack in order to benefit fully from the apps ecosystem.
Server arrangements
Django can be run in conjunction with
Apache
The Apache () are a group of culturally related Native American tribes in the Southwestern United States, which include the Chiricahua, Jicarilla, Lipan, Mescalero, Mimbreño, Ndendahe (Bedonkohe or Mogollon and Nednhi or Carrizaleño an ...
,
Nginx using
WSGI,
Gunicorn, or
Cherokee using flup (a Python module). Django also includes the ability to launch a
FastCGI server, enabling use behind any web server which supports FastCGI, such as
Lighttpd or
Hiawatha. It is also possible to use other
WSGI-compliant web servers. Django officially supports five database backends:
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 ...
,
MySQL,
MariaDB,
SQLite, and
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 word '' ...
.
Microsoft SQL Server can be used with django-mssql while similarly external backends exist for
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 a ...
,
SQL Anywhere and
Firebird. There is a
fork named django-nonrel, which supports
NoSQL
A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
databases, such as
MongoDB and
Google App Engine's Datastore.
Django may also be run in conjunction 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 standa ...
on any
Java EE application server such as
GlassFish or
JBoss. In this case django-jython must be installed in order to provide
JDBC drivers for database connectivity, which also can provide functionality to compile Django in to a .war suitable for deployment.
Version history
The Django team will occasionally designate certain releases to be "long-term support" (LTS) releases. LTS releases will get security and data loss fixes applied for a guaranteed period of time, typically 3+ years, regardless of the pace of releases afterwards.
DjangoCon
There is a semiannual conference for Django developers and users, named "DjangoCon", that has been held since September 2008. DjangoCon is held annually in Europe, in May or June; while another is held in the United States in August or September, in various cities. The 2012 DjangoCon took place in Washington, D.C., from 3 to 8 September. 2013 DjangoCon was held in Chicago at the Hyatt Regency Hotel and the post-conference
Sprints
Sprint may refer to:
Aerospace
*Spring WS202 Sprint, a Canadian aircraft design
*Sprint (missile), an anti-ballistic missile
Automotive and motorcycle
* Alfa Romeo Sprint, automobile produced by Alfa Romeo between 1976 and 1989
*Chevrolet Sprint ...
were hosted at Digital Bootcamp, computer training center. The 2014 DjangoCon US returned to
Portland
Portland most commonly refers to:
* Portland, Oregon, the largest city in the state of Oregon, in the Pacific Northwest region of the United States
* Portland, Maine, the largest city in the state of Maine, in the New England region of the northeas ...
, OR from 30 August to 6 September. The 2015 DjangoCon US was held in
Austin
Austin is the capital city of the U.S. state of Texas, as well as the seat and largest city of Travis County, with portions extending into Hays and Williamson counties. Incorporated on December 27, 1839, it is the 11th-most-populous city ...
, TX from 6 to 11 September at the AT&T Executive Center. The 2016 DjangoCon US was held in Philadelphia, PA at The
Wharton School of the University of Pennsylvania from 17 to 22 July. The 2017 DjangoCon US was held in Spokane, WA; in 2018 DjangoCon US was held in San Diego, CA. DjangoCon US 2019 was held again in San Diego, CA from Sept 22–27. DjangoCon 2021 took place virtually and in 2022, DjangoCon US returned to San Diego from October 16th to the 21st.
Django mini-conferences are usually held every year as part of the Australian
Python Conference 'PyCon AU'. Previously, these mini-conferences have been held in:
*
Hobart
Hobart ( ; Nuennonne/Palawa kani: ''nipaluna'') is the capital and most populous city of the Australian island state of Tasmania. Home to almost half of all Tasmanians, it is the least-populated Australian state capital city, and second-small ...
, Australia, in July 2013,
*
Brisbane, Australia, in August 2014 and 2015,
*
Melbourne, Australia in August 2016 and 2017, and
*
Sydney
Sydney ( ) is the capital city of the state of New South Wales, and the most populous city in both Australia and Oceania. Located on Australia's east coast, the metropolis surrounds Sydney Harbour and extends about towards the Blue Mountain ...
, Australia, in August 2018 and 2019.
Django has spawned user groups and meetups around the world, the most notable group is the
Django Girls organization, which began in Poland but now has had events in 91 countries.
Ports to other languages
Programmers have ported Django's template engine design from Python to other languages, providing decent cross-platform support. Some of these options are more direct ports; others, though inspired by Django and retaining its concepts, take the liberty to deviate from Django's design:
* Liquid for
Ruby
* Template::Swig for
Perl
*
Twig for
PHP and
JavaScript
*
Jinja for
Python
* ErlyDTL for
Erlang
CMSs based on Django Framework
Django as a framework is capable of building a complete
CMS, however there are dedicated CMS projects which are built upon and extend the Django framework. Below is a list of a few of the more popular Django-based CMSs:
*
Django CMS
django CMS is a free and open source content management system platform for publishing content on the World Wide Web and intranets. It is written in Django language framework, with Python.
History
django CMS 1.0 was created by Thomas Steinach ...
*
Wagtail
*
Mezzanine
A mezzanine (; or in Italian language, Italian, a ''mezzanino'') is an intermediate floor in a building which is partly open to the double-height ceilinged floor below, or which does not extend over the whole floorspace of the building, a loft ...
See also
*
FastAPI
*
Flask
*
Pylons project
*
Web2py
*
Tornado
*
Ruby on Rails
*
Comparison of web frameworks Two comparisons of web frameworks are available:
* Comparison of JavaScript-based web frameworks (front-end)
* Comparison of server-side web frameworks
This is a comparison of notable web frameworks, software used to build and deploy web applicat ...
References
Bibliography
*
*
*
*
*
*
*
External links
*
{{DEFAULTSORT:Django
Free software programmed in Python
Python (programming language) web frameworks
Software using the BSD license
Web frameworks