django.contrib.postgres

PostgreSQL has a number of features which are not shared by the other databasesDjango supports. This optional module contains model fields and form fields fora number of PostgreSQL specific data types.

注解

Django is, and will continue to be, a database-agnostic web framework. Wewould encourage those writing reusable applications for the Djangocommunity to write database-agnostic code where practical. However, werecognize that real world projects written using Django need not bedatabase-agnostic. In fact, once a project reaches a given size changingthe underlying data store is already a significant challenge and is likelyto require changing the code base in some ways to handle differencesbetween the data stores.

Django provides support for a number of data types which willonly work with PostgreSQL. There is no fundamental reason why (for example)a contrib.mysql module does not exist, except that PostgreSQL has therichest feature set of the supported databases so its users have the mostto gain.