Django (informatica)
Django è un framework open source per lo sviluppo di applicazioni web, scritto in linguaggio Python, seguendo il pattern Model-View-Controller. Venne concepito inizialmente per gestire diversi siti di notizie per la World Company di Lawrence, Kansas, e venne rilasciato sotto una licenza BSD a luglio 2005. Al momento Django è alla versione 0.91, e la compatibilità all'indietro non e' garantita fino alla release 1.0.
Introduzione e funzionalità
Come Ruby on Rails, un'altro popolare framework, Django è stato utilizzato per diverso tempo prima di essere rilasciato pubblicamente; e' stato sviluppato da Adrian Holovaty, Simon Willison, Jacob Kaplan-Moss e Wilson Miner mentre lavoravano alla World Company, e venne utilizzato inizialmente nella gestione di tre siti di notizie: The Lawrence Journal-World, lawrence.com e KUsports.com. Django is named for jazz guitarist Django Reinhardt.
Django's background in managing news sites is evident in its design, as it provides a number of features which facilitate the rapid development of content-oriented websites. For example, rather than requiring developers to build controllers and views for administration areas of a site, Django provides a built-in content-administration application which can be included as part of any Django-powered site and which can manage multiple Django-powered sites from one installation; the administrative application allows for the creation, updating and deleting of content objects with full logs of actions performed on each, and provides an interface for the management of users and user groups (including assignment of permissions).
The main Django distribution also bundles applications which provide a comment system; tools for syndicating content via RSS and/or Atom; "flat pages" which allow for pages of content to be managed without the need to write controllers or views for those pages; and URL redirection capabilities.
Other features of Django include:
- An object-relational mapper.
- "Pluggable" applications which can be installed into any Django-powered site.
- A robust database API.
- A built-in "generic views" system which does away with the need to write logic for certain common tasks.
- An extensible tag-based template system with template inheritance.
- A regular-expression-based URL dispatcher.
- A "middleware" system for the development of additional features; for example, middleware components which provide caching, output compression, URL normalization, CSRF protection and session support are included in the main Django distribution.
- Support for internationalization, including built-in translations of the administrative application's interface into a variety of languages.
- Built-in documentation accessible via the administrative application (including automatically-generated documentation of models and template tag libraries added by applications).
While Django is influenced heavily by the Model-View-Controller philosophy of development, its developers publicly state that they do not feel bound to strictly observe any particular paradigm, preferring instead to do "what feels right" to them. As a result, for example, what would be called the "controller" in a "true" MVC framework is, in Django, called the "view", and what would be called the "view" is called the "template".
Server arrangements
Django can run on Apache under mod_python, or under any WSGI-compliant web server. Django also includes the ability to launch a FastCGI server, enabling use behind any web server which supports FastCGI.
The following databases are officially supported for use with Django:
Adapters for Microsoft SQL Server and Oracle are under development, but are still experimental.