Django (informatica)

framework per Python
Versione del 6 lug 2006 alle 15:20 di Fstab (discussione | contributi) (traduzione in corso...)

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 è il nome del chitarrista jazz Django Reinhardt.

L'orientamento che ha Django nella gestione dei siti di notizie è evidente nel suo design, poichè fornisce un certo numero di funzionalità che facilitano lo sviluppo rapido di applicazioni per la gestione di contenuti. Per esempio, invece che richiedere sviluppatori per la realizzazione di controllers e views per aree di amministrazione di un sito, Django fornisce una soluzione integrata di amministrazione dei conenuti che può essere inclusa come parte di ogni sito basato su Django e che può gestire molti siti Django da una unica installazione. L'applicazione per l'amministrazione permette di creare, aggiornare e eliminare contenuti rappresentati da oggetti tenendo traccia di tutte le operazioni effettuate e fornisce un'interfaccia per la gestione di utenti e gruppi di utenti (inclusa la gestione dei permessi).

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.