“Django/docs/3.0.x/ref/contrib/index”的版本间差异

来自菜鸟教程
Django/docs/3.0.x/ref/contrib/index
跳转至:导航、​搜索
(autoload)
 
(Page commit)
 
第1行: 第1行:
 +
{{DISPLAYTITLE:contrib 包 — Django 文档}}
 
<div id="contrib-packages" class="section">
 
<div id="contrib-packages" class="section">
  
= <code>contrib</code> packages =
+
= contrib =
  
Django aims to follow Python's <span class="xref std std-ref">&quot;batteries included&quot; philosophy</span>. It ships with a variety of extra, optional tools
+
Django 旨在遵循 Python <span class="xref std std-ref">“包含电池”的理念 </span>。 它附带了各种额外的可选工具,用于解决常见的 Web 开发问题。
that solve common Web-development problems.
 
  
This code lives in <code>django/contrib</code> in the Django distribution. This document
+
此代码位于 Django 发行版中的 <code>django/contrib</code> 中。 本文档简要介绍了 <code>contrib</code> 中的软件包,以及这些软件包具有的任何依赖项。
gives a rundown of the packages in <code>contrib</code>, along with any dependencies
 
those packages have.
 
  
 
<div class="admonition-note admonition">
 
<div class="admonition-note admonition">
  
注释
+
注意
  
For most of these add-ons -- specifically, the add-ons that include either
+
对于大多数这些附加组件——特别是包含模型或模板标签的附加组件——您需要将包名称(例如,<code>'django.contrib.redirects'</code>)添加到您的 [[#id1|:setting:` INSTALLED_APPS`]] 设置并重新运行 <code>manage.py migrate</code>
models or template tags -- you'll need to add the package name (e.g.,
 
<code>'django.contrib.redirects'</code>) to your [[../../settings#std-setting-INSTALLED_APPS|<code>INSTALLED_APPS</code>]] setting
 
and re-run <code>manage.py migrate</code>.
 
  
  
第23行: 第18行:
 
<div class="toctree-wrapper compound">
 
<div class="toctree-wrapper compound">
  
* [[../admin/index|The Django admin site]]
+
* [[../admin/index|Django 管理站点]]
 
* [[../auth|<code>django.contrib.auth</code>]]
 
* [[../auth|<code>django.contrib.auth</code>]]
* [[../contenttypes|The contenttypes framework]]
+
* [[../contenttypes|内容类型框架]]
* [[../flatpages|The flatpages app]]
+
* [[../flatpages|平面应用程序]]
* [[../gis/index|GeoDjango]]
+
* [[../gis/index|吉奥姜戈]]
 
* [[../humanize|<code>django.contrib.humanize</code>]]
 
* [[../humanize|<code>django.contrib.humanize</code>]]
* [[../messages|The messages framework]]
+
* [[../messages|消息框架]]
 
* [[../postgres/index|<code>django.contrib.postgres</code>]]
 
* [[../postgres/index|<code>django.contrib.postgres</code>]]
* [[../redirects|The redirects app]]
+
* [[../redirects|重定向应用]]
* [[../sitemaps|The sitemap framework]]
+
* [[../sitemaps|站点地图框架]]
* [[../sites|The &quot;sites&quot; framework]]
+
* [[../sites|“站点”框架]]
* [[../staticfiles|The <code>staticfiles</code> app]]
+
* [[../staticfiles|<code>staticfiles</code> 应用程序]]
* [[../syndication|The syndication feed framework]]
+
* [[../syndication|联合提要框架]]
  
  
第41行: 第36行:
 
<div id="admin" class="section">
 
<div id="admin" class="section">
  
== <code>admin</code> ==
+
== admin ==
  
The automatic Django administrative interface. For more information, see
+
自动 Django 管理界面。 有关更多信息,请参阅 [[../../../intro/tutorial02|教程 2]] [[../admin/index|管理文档]]
[[../../../intro/tutorial02|<span class="doc">Tutorial 2</span>]] and the
 
[[../admin/index|<span class="doc">admin documentation</span>]].
 
  
Requires the [[#auth|auth]] and [[#contenttypes|contenttypes]] contrib packages to be installed.
+
需要安装 [[#auth|auth]] [[#contenttypes|contenttypes]] contrib 包。
  
  
第53行: 第46行:
 
<div id="auth" class="section">
 
<div id="auth" class="section">
  
== <code>auth</code> ==
+
== auth ==
  
Django's authentication framework.
+
Django 的身份验证框架。
  
See [[../../../topics/auth/index|<span class="doc">Django中的用户认证</span>]].
+
请参阅 [[../../../topics/auth/index|Django 中的用户身份验证]]
  
  
第63行: 第56行:
 
<div id="contenttypes" class="section">
 
<div id="contenttypes" class="section">
  
== <code>contenttypes</code> ==
+
== contenttypes ==
  
A light framework for hooking into &quot;types&quot; of content, where each installed
+
一个用于挂钩内容“类型”的轻量级框架,其中每个安装的 Django 模型都是一个单独的内容类型。
Django model is a separate content type.
 
  
See the [[../contenttypes|<span class="doc">contenttypes documentation</span>]].
+
请参阅 [[../contenttypes|内容类型文档]]
  
  
第74行: 第66行:
 
<div id="flatpages" class="section">
 
<div id="flatpages" class="section">
  
== <code>flatpages</code> ==
+
== flatpages ==
  
A framework for managing &quot;flat&quot; HTML content in a database.
+
用于管理数据库中“平面”HTML 内容的框架。
  
See the [[../flatpages|<span class="doc">flatpages documentation</span>]].
+
请参阅 [[../flatpages|平面文档]]
  
Requires the [[#sites|sites]] contrib package to be installed as well.
+
还需要安装 [[#sites|sites]] contrib 包。
  
  
第86行: 第78行:
 
<div id="gis" class="section">
 
<div id="gis" class="section">
  
== <code>gis</code> ==
+
== gis ==
  
A world-class geospatial framework built on top of Django, that enables
+
一个建立在 Django 之上的世界级地理空间框架,支持空间数据的存储、操作和显示。
storage, manipulation and display of spatial data.
 
  
See the [[../gis/index|<span class="doc">GeoDjango</span>]] documentation for more.
+
有关更多信息,请参阅 [[../gis/index|GeoDjango]] 文档。
  
  
第97行: 第88行:
 
<div id="humanize" class="section">
 
<div id="humanize" class="section">
  
== <code>humanize</code> ==
+
== humanize ==
  
A set of Django template filters useful for adding a &quot;human touch&quot; to data.
+
一组 Django 模板过滤器,可用于向数据添加“人性化”。
  
See the [[../humanize|<span class="doc">humanize documentation</span>]].
+
请参阅 [[../humanize|人性化文档]]
  
  
第107行: 第98行:
 
<div id="messages" class="section">
 
<div id="messages" class="section">
  
== <code>messages</code> ==
+
== messages ==
  
A framework for storing and retrieving temporary cookie- or session-based
+
用于存储和检索基于 cookie 或会话的临时消息的框架
messages
 
  
See the [[../messages|<span class="doc">messages documentation</span>]].
+
请参阅 [[../messages|消息文档]]
  
  
第118行: 第108行:
 
<div id="postgres" class="section">
 
<div id="postgres" class="section">
  
== <code>postgres</code> ==
+
== postgres ==
  
A collection of PostgreSQL specific features.
+
PostgreSQL 特定功能的集合。
  
See the [[../postgres/index|<span class="doc">contrib.postgres documentation</span>]].
+
请参阅 [[../postgres/index|contrib.postgres 文档]]
  
  
第128行: 第118行:
 
<div id="redirects" class="section">
 
<div id="redirects" class="section">
  
== <code>redirects</code> ==
+
== redirects ==
  
A framework for managing redirects.
+
用于管理重定向的框架。
  
See the [[../redirects|<span class="doc">redirects documentation</span>]].
+
请参阅 [[../redirects|重定向文档]]
  
  
第138行: 第128行:
 
<div id="sessions" class="section">
 
<div id="sessions" class="section">
  
== <code>sessions</code> ==
+
== sessions ==
  
A framework for storing data in anonymous sessions.
+
在匿名会话中存储数据的框架。
  
See the [[../../../topics/http/sessions|<span class="doc">sessions documentation</span>]].
+
请参阅 [[../../../topics/http/sessions|会话文档]]
  
  
第148行: 第138行:
 
<div id="sites" class="section">
 
<div id="sites" class="section">
  
== <code>sites</code> ==
+
== sites ==
  
A light framework that lets you operate multiple websites off of the same
+
一个轻量级框架,可让您从同一个数据库和 Django 安装中操作多个网站。 它为您提供了将对象与一个或多个站点相关联的钩子。
database and Django installation. It gives you hooks for associating objects to
 
one or more sites.
 
  
See the [[../sites|<span class="doc">sites documentation</span>]].
+
请参阅 [[../sites|站点文档]]
  
  
第160行: 第148行:
 
<div id="sitemaps" class="section">
 
<div id="sitemaps" class="section">
  
== <code>sitemaps</code> ==
+
== sitemaps ==
  
A framework for generating Google sitemap XML files.
+
用于生成 Google 站点地图 XML 文件的框架。
  
See the [[../sitemaps|<span class="doc">sitemaps documentation</span>]].
+
请参阅 [[../sitemaps|站点地图文档]]
  
  
第170行: 第158行:
 
<div id="syndication" class="section">
 
<div id="syndication" class="section">
  
== <code>syndication</code> ==
+
== syndication ==
  
A framework for generating syndication feeds, in RSS and Atom, quite easily.
+
一个在 RSS Atom 中很容易生成联合提要的框架。
  
See the [[../syndication|<span class="doc">syndication documentation</span>]].
+
请参阅 [[../syndication|联合文档]]
  
  
第180行: 第168行:
 
<div id="other-add-ons" class="section">
 
<div id="other-add-ons" class="section">
  
== Other add-ons ==
+
== 其他附加组件 ==
  
If you have an idea for functionality to include in <code>contrib</code>, let us know!
+
如果您对包含在 <code>contrib</code> 中的功能有任何想法,请告诉我们! 编写代码,并将其发布到 [[../../../internals/mailing-lists#django-users-mailing-list|django-users]] 邮件列表。
Code it up, and post it to the [[../../../internals/mailing-lists#django-users-mailing-list|<span class="std std-ref">django-users</span>]] mailing list.
 
  
  
第189行: 第176行:
  
 
</div>
 
</div>
 +
<div class="clearer">
  
[[Category:Django 3.0.x 中文文档]]
+
 
 +
 
 +
</div>
 +
 
 +
[[Category:Django 3.0.x 文档]]

2021年10月31日 (日) 04:09的最新版本

contrib 包

Django 旨在遵循 Python 的 “包含电池”的理念 。 它附带了各种额外的可选工具,用于解决常见的 Web 开发问题。

此代码位于 Django 发行版中的 django/contrib 中。 本文档简要介绍了 contrib 中的软件包,以及这些软件包具有的任何依赖项。

注意

对于大多数这些附加组件——特别是包含模型或模板标签的附加组件——您需要将包名称(例如,'django.contrib.redirects')添加到您的 :setting:` INSTALLED_APPS` 设置并重新运行 manage.py migrate


admin

自动 Django 管理界面。 有关更多信息,请参阅 教程 2管理文档

需要安装 authcontenttypes contrib 包。


auth

Django 的身份验证框架。

请参阅 Django 中的用户身份验证


contenttypes

一个用于挂钩内容“类型”的轻量级框架,其中每个安装的 Django 模型都是一个单独的内容类型。

请参阅 内容类型文档


flatpages

用于管理数据库中“平面”HTML 内容的框架。

请参阅 平面文档

还需要安装 sites contrib 包。


gis

一个建立在 Django 之上的世界级地理空间框架,支持空间数据的存储、操作和显示。

有关更多信息,请参阅 GeoDjango 文档。


humanize

一组 Django 模板过滤器,可用于向数据添加“人性化”。

请参阅 人性化文档


messages

用于存储和检索基于 cookie 或会话的临时消息的框架

请参阅 消息文档


postgres

PostgreSQL 特定功能的集合。

请参阅 contrib.postgres 文档


redirects

用于管理重定向的框架。

请参阅 重定向文档


sessions

在匿名会话中存储数据的框架。

请参阅 会话文档


sites

一个轻量级框架,可让您从同一个数据库和 Django 安装中操作多个网站。 它为您提供了将对象与一个或多个站点相关联的钩子。

请参阅 站点文档


sitemaps

用于生成 Google 站点地图 XML 文件的框架。

请参阅 站点地图文档


syndication

一个在 RSS 和 Atom 中很容易生成联合提要的框架。

请参阅 联合文档


其他附加组件

如果您对包含在 contrib 中的功能有任何想法,请告诉我们! 编写代码,并将其发布到 django-users 邮件列表。