Você está na página 1de 6

Django (web framework)

For other uses, see Django.

Warning: Page using Template:Infobox software with


unknown parameter repository (this message is shown
only in preview).

Django (/do/ JANG-goh)[5] is a free and open-


source web framework, written in Python, which fol-
lows the model-view-template (MVT) architectural pat-
tern.[6][7] It is maintained by the Django Software Foun-
dation (DSF), an independent organization established as
a 501(c)(3) non-prot.
Djangos 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 don't repeat yourself. Python is
used throughout, even for settings les and data models.
Django also provides an optional administrative create,
read, update and delete interface that is generated dy-
namically through introspection and congured via admin
models.
Some well-known sites that use Django include the Public
Broadcasting Service,[8] Pinterest,[9] Instagram,[10]
Mozilla,[11] The Washington Times,[12] Disqus,[13]
Bitbucket,[14] and Nextdoor.[15]

1 History
Django was born in the fall of 2003, when the web
programmers at the Lawrence Journal-World newspa-
per, Adrian Holovaty and Simon Willison, began using
Python to build applications.[16] It was released publicly
under a BSD license in July 2005. The framework was
named after guitarist Django Reinhardt.[16]
In June 2008, it was announced that a newly formed Screenshot of the Django admin interface for modifying a user
Django Software Foundation (DSF) would maintain account.
Django in the future.[17]

2 Features as an MVC architecture.[7] It consists of an object-


relational mapper (ORM) that mediates between data
2.1 Components models (dened as Python classes) and a relational
database ("Model), a system for processing HTTP re-
Despite having its own nomenclature, such as nam- quests with a web templating system ("View), and a
ing the callable objects generating the HTTP responses regular-expression-based URL dispatcher ("Controller).
views,[6] the core Django framework can be seen Also included in the core framework are:

1
2 4 DEVELOPMENT TOOLS WITH DJANGO SUPPORT

a lightweight and standalone web server for develop- 2.3 Extensibility


ment and testing
Djangos conguration system allows third party code to
a form serialization and validation system that can be plugged into a regular project, provided that it fol-
translate between HTML forms and values suitable lows the reusable app[20] conventions. More than 2500
for storage in the database packages[21] are available to extend the frameworks orig-
inal behavior, providing solutions to issues the original
a template system that utilizes the concept of tool didn't tackle: registration, search, API provision and
inheritance borrowed from object-oriented pro- consumption, CMS, etc.
gramming
This extensibility is, however, mitigated by internal com-
a caching framework that can use any of several ponents dependencies. While the Django philosophy im-
[22]
cache methods plies loose coupling, the template lters and tags as-
sume one engine implementation, and both the auth and
support for middleware classes that can intervene at admin bundled applications require the use of the internal
various stages of request processing and carry out ORM. None of these lters or bundled apps are manda-
custom functions tory to run a Django project, but reusable apps tend to
depend on them, encouraging developers to keep using
an internal dispatcher system that allows compo- the ocial stack in order to benet fully from the apps
nents of an application to communicate events to ecosystem.
each other via pre-dened signals

an internationalization system, including transla- 2.4 Server arrangements


tions of Djangos own components into a variety of
languages Django can be run in conjunction with Apache, NGINX
using WSGI, Gunicorn, or Cherokee using up (a
a serialization system that can produce and read Python module).[23][24] Django also includes the ability
XML and/or JSON representations of Django to launch a FastCGI server, enabling use behind any
model instances web server which supports FastCGI, such as Lighttpd
or Hiawatha. It is also possible to use other WSGI-
a system for extending the capabilities of the tem- compliant web servers.[25] Django ocially supports four
plate engine database backends: PostgreSQL, MySQL, SQLite, and
Oracle. Microsoft SQL Server can be used with django-
an interface to Pythons built in unit test framework mssql on Microsoft operating systems,[26] while sim-
ilarly external backends exist for IBM DB2,[27] SQL
Anywhere[28] and Firebird.[29] There is a fork named
2.2 Bundled applications django-nonrel, which supports NoSQL databases, such as
MongoDB and Google App Engine's Datastore.[30]
The main Django distribution also bundles a number of
Django may also be run in conjunction with Jython on any
applications in its contrib package, including:
Java EE application server such as GlassFish or JBoss.
In this case django-jython must be installed in order to
an extensible authentication system provide JDBC drivers for database connectivity, which
also provides functionality to compile Django in to a .war
the dynamic administrative interface suitable for deployment.[31]
Google App Engine includes support for Django version
tools for generating RSS and Atom syndication feeds
1.x.x[32] as one of the bundled frameworks.
a sites framework that allows one Django installation
to run multiple websites, each with their own content
and applications 3 Version history
tools for generating Google Sitemaps
4 Development tools with Django
built-in mitigation for cross-site request forgery,
cross-site scripting, SQL injection, password crack- support
ing and other typical web attacks, most of them
turned on by default[18][19] For developing a Django project, no special tools are nec-
essary, since the source code can be edited with any con-
a framework for creating GIS applications ventional text editor. Nevertheless, editors specialized on
3

computer programming can help increase the productiv- Jinja for Python
ity of development, e.g. with features such as syntax high-
lighting. Since Django is written in Python, text editors ErlyDTL for Erlang
which are aware of Python syntax are benecial in this
regard.
Integrated development environments (IDE) add further
7 Bibliography
functionality, such as debugging, refactoring, unit test-
ing, etc. As with plain editors, IDEs with support for Roy Greenfeld, Daniel; Roy Greenfeld, Audrey
Python can be benecial. Some IDEs that are special- (2015), Two Scoops of Django: Best Practices for
ized on Python additionally have integrated support for Django 1.8 (3rd ed.), Two Scoops Press, p. 531,
Django projects, so that using such an IDE when devel- ISBN 0981467342
oping a Django project can help further increase produc-
Jaiswal, Sanjeev; Kumar, Ratan (22 June 2015),
tivity. For comparison of such Python IDEs, see the main
Learning Django Web Development (1st ed.), Packt,
article:
p. 405, ISBN 1783984406
Main article: Comparison of integrated development
environments Python Ravindrun, Arun (31 March 2015), Django Design
Patterns and Best Practices (1st ed.), Packt, p. 180,
ISBN 1783986646

Osborn, Tracy (May 2015), Hello Web App (1st ed.),


5 Community Tracy Osborn, p. 142, ISBN 0986365912

There is a semiannual conference for Django develop- Bendoraitis, Aidas (October 2014), Web Develop-
ers and users, named DjangoCon, that has been held ment with Django Cookbook (1st ed.), Packt, p. 294,
since September 2008. DjangoCon is held annually in ISBN 178328689X
[52]
Europe, in May or June; while another is held in Baumgartner, Peter; Malet, Yann (2015), High Per-
the United States in August or September, in various formance Django (1st ed.), Lincoln Loop, p. 184,
cities.[53] The 2012 DjangoCon took place in Washing- ISBN 1508748128
ton D.C from 3 to 8 September. 2013 DjangoCon was
held in Chicago at the Hyatt Regency Hotel and the Elman, Julia; Lavin, Mark (2014), Lightweight
post-conference Sprints were hosted at Digital Bootcamp, Django (1st ed.), O'Reilly Media, p. 246, ISBN
computer training center.[54] The 2014 DjangoCon US 149194594X
returned to Portland, WA from 30 August to 6 Septem-
ber. The 2015 DjangoCon US was held in Austin, TX Percival, Harry (2014), Test-Driven Development
from 6 to 11 September at the AT&T Executive Center. with Python (1st ed.), O'Reilly Media, p. 480, ISBN
The 2016 DjangoCon US was held in Philadelphia, PA 1449364829
at The Wharton School of the University of Pennsylvania
from 17 to 22 July.[55] This list is an extraction from Current Django Books
Django mini-conferences were held in Hobart, Australia
in July 2013, in Brisbane, Australia in August 2014 and
2015, and in Melbourne, Australia in 2016.[56] 8 See also
Flask (web framework)
6 Ports to other languages Pylons project

Programmers have ported Djangos template design from Comparison of web frameworks
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 9 References
concepts, take the liberty to deviate from Djangos design:
[1] Django FAQ. Retrieved 2 September 2014.
Swig for JavaScript
[2] Graham, Tim (4 April 2017). Django 1.11 released.
Liquid for Ruby Django Weblog. Retrieved 4 April 2017.

Template::Swig for Perl [3] Graham, Tim (21 March 2017). Django 1.11 release
candidate 1 released. Django Weblog. Retrieved 22
Twig for PHP March 2017.
4 9 REFERENCES

[4] Django Download. Retrieved 17 January 2017. [28] Google Code Archive - Long-term storage for Google
Code Project Hosting.. Retrieved 30 April 2016.
[5] FAQ: General - Django documentation - Django. Re-
trieved 30 April 2016. [29] maxirobaina. GitHub - maxirobaina/django-rebird:
Firebird SQL backend for django. GitHub. Retrieved
[6] FAQ: General - Django documentation - Django. Re- 30 April 2016.
trieved 30 April 2016.
[30] Django non-rel. Retrieved 30 April 2016.
[7] Adrian Holovaty, Jacob Kaplan-Moss; et al. The Django
Book. Django follows this MVC pattern closely enough [31] beachmachine. GitHub - beachmachine/django-jython:
that it can be called an MVC framework Database backends and extensions for Django develop-
ment on top of Jython.. GitHub. Retrieved 30 April
[8] 20 Creative Websites Running Django. 2016.
[9] What is the technology stack behind Pinterest?". Re-
[32] Running Pure Django Projects on Google App Engine.
trieved 30 April 2016.
Code.google.com (2010-11-01). Retrieved on 5 Decem-
[10] What Powers Instagram: Hundreds of Instances, Dozens ber 2011.
of Technologies.
[33] Introducing Django 0.90. Django weblog. Retrieved 2
[11] Python. Mozilla Developer Network. Retrieved 30 April February 2013.
2016.
[34] Django 0.91 released. Django weblog. Retrieved 2
[12] Opensource.washingtontimes.com. Retrieved on 2014- February 2013.
05-30.
[35] Introducing Django 0.95. Django weblog. Retrieved 2
[13] Scaling Django to 8 Billion Page Views. February 2013.

[14] DjangoSuccessStoryBitbucket Django. Retrieved 30 [36] Announcing Django 0.96!". Django weblog. Retrieved
April 2016. 2 February 2013.

[15] The anti-Facebook: one in four American neighbor- [37] Django 1.0 released!". Django weblog. Retrieved 2
hoods are now using this private social network. The February 2013.
Verge. Retrieved 16 June 2016.
[38] Django 1.1 released. Django weblog. Retrieved 2
[16] Djangos History. The Django Book. Retrieved 6 June February 2013.
2013.
[39] Django 1.2 released. Django weblog. Retrieved 2
[17] Announcing the Django Software Foundation - Weblog - February 2013.
Django. Retrieved 30 April 2016.
[40] Django 1.3 released. Django weblog. Retrieved 2
[18] Security in Django. Django Project. Retrieved 25 February 2013.
March 2013.
[41] Django 1.4 released. Django weblog. Retrieved 2
[19] Socol, James (2012). Best Basic Security Practices (Es- February 2013.
pecially with Django)". Retrieved 25 March 2013.
[42] Djangos release process - Django documentation -
[20] What is a reusable app? django-reusable-app-docs Django. Retrieved 30 April 2016.
0.1.0 documentation. Retrieved 30 April 2016.
[43] Django 1.5 released Django weblog. Retrieved 27
[21] Django Packages. Retrieved 30 April 2016. February 2013.
[22] Design philosophies - Django documentation - Django. [44] Django 1.6 released Django weblog. Retrieved 6
Retrieved 30 April 2016. November 2013.
[23] Django documentation of deployment Archived 11 Jan- [45] Django 1.7 released Django weblog. Retrieved 4
uary 2012 at the Wayback Machine. September 2014.
[24] Cherokee Web Server - Cookbook Setting up Django - [46] Django 1.8 released Django weblog. Retrieved 2 April
Cherokee Documentation. Retrieved 30 April 2016. 2015.
[25] How to use Django with Apache and mod_wsgi Archived [47] Django 1.9 released Django weblog. Retrieved 1 De-
8 March 2013 at the Wayback Machine.. Ocial Django cember 2015.
documentation.
[48] Django 1.10 released Django weblog. Retrieved 1 Au-
[26] Manfre / django-mssql / source / Bitbucket. Re- gust 2016.
trieved 30 April 2016.
[49] " Django weblog. Retrieved 4 April 2017.
[27] ibmdb. GitHub - ibmdb/python-ibmdb: Automatically
exported from code.google.com/p/ibm-db". GitHub. Re- [50] Download Django Download Django. Retrieved 9 De-
trieved 30 April 2016. cember 2016.
5

[51] Download Django Download Django. Retrieved 9 De-


cember 2016.

[52] DjangoCon EU series, Lanyrd.com

[53] DjangoCon US series, Lanyrd.com

[54] DjangoCon. DjangoCon. Archived from the original on


5 August 2012. Retrieved 29 July 2012.

[55] DjangoCon. DjangoCon. Retrieved 1 December 2016.

[56] DjangoCon AU. Djangocon.com.au. Retrieved on 2016-


09-23.

10 External links
Ocial website

Django Ocial Documentation - Current and de-


tailed documentation on nearly every aspect of
Django. It includes a version selector for informa-
tion pertaining to specic versions of Django.

Two Scoops Press Curated List of Django Tutorials


- A comprehensive list of up-to-date Django tutori-
als.
Tango with Django - A beginners tutorial to web
development with Django.
Taskbuster - A tutorial for experienced coders who
want to learn Django.
Django Packages - A directory of reusable apps,
sites, tools, and more for Django projects.
Django Girls ocial tutorial . Tutorial was built in
mind for people starting learning programming.
6 11 TEXT AND IMAGE SOURCES, CONTRIBUTORS, AND LICENSES

11 Text and image sources, contributors, and licenses


11.1 Text
Django (web framework) Source: https://en.wikipedia.org/wiki/Django_(web_framework)?oldid=776988209 Contributors: Frecklefoot,
Edward, Pnm, Kku, Haakon, Bronger, Ciphergoth, Mxn, Ehn, Topbanana, Mariuz, Finlay McWalter, Chealer, Psychonaut, Rfc1394,
Rrjanbiah, Msiebuhr, Cloud200, Nidico, Spatz, Cynical, Urhixidur, Subsume, Thorwald, Tom X. Tobin, Bender235, Kwamikagami, We-
stonRuter, Giraedata, Gary, Anthony Appleyard, ChrisUK, Tobych, Diego Moya, RoySmith, Sligocki, Phocks, Ubernostrum, Kenyon,
Jigsaw~enwiki, Mindmatrix, David Haslam, Notbot, Waldir, Tom W.M., Platte (usurped), Lastorset, Datakid, Pleiotrop3, Xueexueg, Sdor-
nan, Smithfarm, Gelma, Maxim Razin, STarry, Drrngrvy, WWC, Ysangkok, Vsion, Phatmonkey, Tom Foolery, KillerX~enwiki, Intgr,
Chobot, Frappyjohn, MichaelK, Peterl, FrankTobia, YurikBot, Jzylstra, Pi Delport, Powerlord, Romanc19s, Wildwobby, Korny O'Near,
D jinn, Brandon, ScottyWZ, Cymbaloum~enwiki, Pnorcks, Amakuha, Bota47, JLaTondre, SpringBoy, SmackBot, Kellen, Hydrology,
Aahlborg, InverseHypercube, Larry Doolittle, Deon Steyn, Elwood j blues, Mcld, Drttm, Ohnoitsjamie, Betacommand, Thumperward, Lu-
narmys, The359, Gracenotes, Frap, Pboyd04, Mwtoews, DKEdwards, Kuru, JorisvS, Erwin, Larrymcp, Armin Ronacher, Tmcw, Dl2000,
Hu12, Norm mit, Paulbx, MicahDCochran, FlipperPA, MaxEnt, Cydebot, Krauss, JJC1138, Gogo Dodo, Chasingsol, Sweecoo, Thijs!bot,
Cgarrod, Hazmat2, Trevyn, Dqd, Ianozsvald, Gioto, Hexene, Obeattie, JAnDbot, Deective, Vl'hurg, AdamGomaa, Xangis, JamesBWat-
son, Vssun, Falcor84, Bitbit, STBot, Panarchy, Yaron K., Adys, Maproom, Andareed, Liangent, Balleyne, FLStyle, Jmhunter, Idioma-bot,
VolkovBot, Genium, Tuxcanty, Swingambassador, Simonscarfe, Sebastjanmm, Zarek, Scottwilleke, Pxma, Caidh, Tperlin, Anakin101,
Chriswood123, Southof40, Niceguyedc, Jalanpalmer, Mspraveen, Alexbot, Watchduck, Therealnih, Xodarap00, Murkt, Thape, Appari-
tion11, SF007, DumZiBoT, XLinkBot, SFFrog, Rror, Aviraldg, Kinda Odd, Addbot, AkhtaBot, Jncraton, Cschand, Jkenzer, ChenzwBot,
Lightbot, Santosga, Che, Margin1522, Luckas-bot, Yobot, Pcap, Harry lp, AnomieBOT, Mkwan79, 1exec1, Gtz, Starproject, Materialsci-
entist, Xaerxess, TalkChat, ArthurBot, Quebec99, Xqbot, Gidoca, 16x9, Al Maghi, Johnsonnenschein, FrescoBot, Svnikolov, Webamor-
phosis, Mark Renier, Ksato9700, Galuszkak, Sae1962, Craig Pemberton, Winterst, Nnehaa, ZephyrXero, Jandalhandler, Beao, Nivl, Per-
sian knight shiraz, Ansumang, Quilz, David Hedlund, Z00zax, Franciscouzo, Javaweb, Mjhea0, EmausBot, WikitanvirBot, , Djem-
bayz, Soccerjonp, AManWithNoPlan, Netha Hussain, Bobogoobo, Ipsign, Vikcena01, Sctao.jack, ClueBot NG, Myfreeweb, Poiuytrez,
Catlemur, Zummed, Eugenia d, Helpful Pixie Bot, Orpheelafondlummis, KLBot2, 2001:db8, BG19bot, VahidRaei, Dlampton, Compf-
reak7, Silvrous, Sebadima, Dstoian, Winston Chuen-Shih Yang, BattyBot, Tianjiao, Syzgyz, Aesmail, Egglampbasket, ChrisGualtieri,
Sunnyok, Desmoulinmichel, Will Faught, The panaceya, Dzmzh, Dautkhanov, Danielstp, William Di Luigi, Mzleft, Mut3chs, XndrK,
Ramiro Morales (aka cramm), Ugog Nizdast, Kontee, Sawan.gupta92, Thes.kumar, Pydanny, Mrrtini, Monkbot, Gensyms, HGabbeh, Jh-
wdc3, Ssx`z, Crystallizedcarbon, Futurespast, Smythp, Norvoid, Flikkka, Ankitjigupta, Onlinelearner85, InternetArchiveBot, GreenC bot,
Redskink, Estertuber and Anonymous: 269

11.2 Images
File:Commons-logo.svg Source: https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg License: PD Contributors: ? Origi-
nal artist: ?
File:Django_default_page.png Source: https://upload.wikimedia.org/wikipedia/commons/0/00/Django_default_page.png License: CC
BY-SA 3.0 Contributors: Transferred from en.wikipedia to Commons by Ssx3max. Original artist: Ubernostrum at English Wikipedia
File:Django_logo.svg Source: https://upload.wikimedia.org/wikipedia/commons/7/75/Django_logo.svg License: Public domain Contrib-
utors: http://www.brandsoftheworld.com/logo/django Original artist: Django
File:Django_useradmin.png Source: https://upload.wikimedia.org/wikipedia/commons/6/6d/Django_useradmin.png License: BSD
Contributors: Own work Original artist: Wilson Miner and others.
File:Free_and_open-source_software_logo_(2009).svg Source: https://upload.wikimedia.org/wikipedia/commons/3/31/Free_and_
open-source_software_logo_%282009%29.svg License: Public domain Contributors: FOSS Logo.svg Original artist: Free Software Portal
Logo.svg (FOSS Logo.svg): ViperSnake151
File:Question_book-new.svg Source: https://upload.wikimedia.org/wikipedia/en/9/99/Question_book-new.svg License: Cc-by-sa-3.0
Contributors:
Created from scratch in Adobe Illustrator. Based on Image:Question book.png created by User:Equazcion Original artist:
Tkgd2007

11.3 Content license


Creative Commons Attribution-Share Alike 3.0

Você também pode gostar