---
title: "Django 文档内容"
version: 2.1
locale: zh-hans
source: https://docs.djangoproject.com/zh-hans/2.1/contents/
canonical: https://djangodocs.dev/zh-hans/2.1/contents/
---
# Django 文档内容

- [开始](/zh-hans/2.1/intro/)

  - [初识 Django](/zh-hans/2.1/intro/overview/)

    - [设计模型](/zh-hans/2.1/intro/overview/#design-your-model)
    - [应用数据模型](/zh-hans/2.1/intro/overview/#install-it)
    - [享用便捷的 API](/zh-hans/2.1/intro/overview/#enjoy-the-free-api)
    - [一个动态管理接口：并非徒有其表](/zh-hans/2.1/intro/overview/#a-dynamic-admin-interface-it-s-not-just-scaffolding-it-s-the-whole-house)
    - [规划 URLs](/zh-hans/2.1/intro/overview/#design-your-urls)
    - [编写视图](/zh-hans/2.1/intro/overview/#write-your-views)
    - [设计模板](/zh-hans/2.1/intro/overview/#design-your-templates)
    - [这仅是基本入门知识](/zh-hans/2.1/intro/overview/#this-is-just-the-surface)
  - [快速安装指南](/zh-hans/2.1/intro/install/)

    - [安装 Python](/zh-hans/2.1/intro/install/#install-python)
    - [设置数据库](/zh-hans/2.1/intro/install/#set-up-a-database)
    - [安装 Django](/zh-hans/2.1/intro/install/#install-django)
    - [验证](/zh-hans/2.1/intro/install/#verifying)
    - [搞定！](/zh-hans/2.1/intro/install/#that-s-it)
  - [编写你的第一个 Django 应用，第 1 部分](/zh-hans/2.1/intro/tutorial01/)

    - [创建项目](/zh-hans/2.1/intro/tutorial01/#creating-a-project)
    - [用于开发的简易服务器](/zh-hans/2.1/intro/tutorial01/#the-development-server)
    - [创建投票应用](/zh-hans/2.1/intro/tutorial01/#creating-the-polls-app)
    - [编写第一个视图](/zh-hans/2.1/intro/tutorial01/#write-your-first-view)
  - [编写你的第一个 Django 应用，第 2 部分](/zh-hans/2.1/intro/tutorial02/)

    - [数据库配置](/zh-hans/2.1/intro/tutorial02/#database-setup)
    - [创建模型](/zh-hans/2.1/intro/tutorial02/#creating-models)
    - [激活模型](/zh-hans/2.1/intro/tutorial02/#activating-models)
    - [初试 API](/zh-hans/2.1/intro/tutorial02/#playing-with-the-api)
    - [介绍 Django 管理页面](/zh-hans/2.1/intro/tutorial02/#introducing-the-django-admin)
  - [编写你的第一个 Django 应用，第 3 部分](/zh-hans/2.1/intro/tutorial03/)

    - [概况](/zh-hans/2.1/intro/tutorial03/#overview)
    - [编写更多视图](/zh-hans/2.1/intro/tutorial03/#writing-more-views)
    - [写一个真正有用的视图](/zh-hans/2.1/intro/tutorial03/#write-views-that-actually-do-something)
    - [抛出 404 错误](/zh-hans/2.1/intro/tutorial03/#raising-a-404-error)
    - [使用模板系统](/zh-hans/2.1/intro/tutorial03/#use-the-template-system)
    - [去除模板中的硬编码 URL](/zh-hans/2.1/intro/tutorial03/#removing-hardcoded-urls-in-templates)
    - [为 URL 名称添加命名空间](/zh-hans/2.1/intro/tutorial03/#namespacing-url-names)
  - [编写你的第一个 Django 应用，第 4 部分](/zh-hans/2.1/intro/tutorial04/)

    - [编写一个简单的表单](/zh-hans/2.1/intro/tutorial04/#write-a-simple-form)
    - [使用通用视图：代码还是少点好](/zh-hans/2.1/intro/tutorial04/#use-generic-views-less-code-is-better)
  - [编写你的第一个 Django 应用，第 5 部分](/zh-hans/2.1/intro/tutorial05/)

    - [自动化测试简介](/zh-hans/2.1/intro/tutorial05/#introducing-automated-testing)
    - [基础测试策略](/zh-hans/2.1/intro/tutorial05/#basic-testing-strategies)
    - [开始写我们的第一个测试](/zh-hans/2.1/intro/tutorial05/#writing-our-first-test)
    - [测试视图](/zh-hans/2.1/intro/tutorial05/#test-a-view)
    - [当需要测试的时候，测试用例越多越好](/zh-hans/2.1/intro/tutorial05/#when-testing-more-is-better)
    - [深入代码测试](/zh-hans/2.1/intro/tutorial05/#further-testing)
    - [接下来要做什么？](/zh-hans/2.1/intro/tutorial05/#what-s-next)
  - [编写你的第一个 Django 应用，第 6 部分](/zh-hans/2.1/intro/tutorial06/)

    - [自定义 *应用* 的界面和风格](/zh-hans/2.1/intro/tutorial06/#customize-your-app-s-look-and-feel)
    - [添加一个背景图](/zh-hans/2.1/intro/tutorial06/#adding-a-background-image)
  - [编写你的第一个 Django 应用，第 7 部分](/zh-hans/2.1/intro/tutorial07/)

    - [自定义后台表单](/zh-hans/2.1/intro/tutorial07/#customize-the-admin-form)
    - [添加关联的对象](/zh-hans/2.1/intro/tutorial07/#adding-related-objects)
    - [自定义后台更改列表](/zh-hans/2.1/intro/tutorial07/#customize-the-admin-change-list)
    - [自定义后台界面和风格](/zh-hans/2.1/intro/tutorial07/#customize-the-admin-look-and-feel)
    - [自定义后台主页](/zh-hans/2.1/intro/tutorial07/#customize-the-admin-index-page)
    - [接下来要做什么？](/zh-hans/2.1/intro/tutorial07/#what-s-next)
  - [进阶指南：如何编写可重用程序](/zh-hans/2.1/intro/reusable-apps/)

    - [可重用性很重要](/zh-hans/2.1/intro/reusable-apps/#reusability-matters)
    - [你的项目和可复用应用](/zh-hans/2.1/intro/reusable-apps/#your-project-and-your-reusable-app)
    - [安装必须环境](/zh-hans/2.1/intro/reusable-apps/#installing-some-prerequisites)
    - [打包你的应用](/zh-hans/2.1/intro/reusable-apps/#packaging-your-app)
    - [使用你自己的包名](/zh-hans/2.1/intro/reusable-apps/#using-your-own-package)
    - [发布你的应用](/zh-hans/2.1/intro/reusable-apps/#publishing-your-app)
    - [通过 virtualenv 安装 Python 包](/zh-hans/2.1/intro/reusable-apps/#installing-python-packages-with-virtualenv)
  - [下一步看什么](/zh-hans/2.1/intro/whatsnext/)

    - [查找文档](/zh-hans/2.1/intro/whatsnext/#finding-documentation)
    - [文档是如何组成](/zh-hans/2.1/intro/whatsnext/#how-the-documentation-is-organized)
    - [这个文档是如何更新的](/zh-hans/2.1/intro/whatsnext/#how-documentation-is-updated)
    - [从哪里获取这个](/zh-hans/2.1/intro/whatsnext/#where-to-get-it)
    - [版本之间的差异](/zh-hans/2.1/intro/whatsnext/#differences-between-versions)
  - [编写你的第一个 Django 补丁](/zh-hans/2.1/intro/contributing/)

    - [介绍](/zh-hans/2.1/intro/contributing/#introduction)
    - [代码规范](/zh-hans/2.1/intro/contributing/#code-of-conduct)
    - [安装Git](/zh-hans/2.1/intro/contributing/#installing-git)
    - [获得一个 Django 开发版本的副本](/zh-hans/2.1/intro/contributing/#getting-a-copy-of-django-s-development-version)
    - [首先运行 Django 的测试套件](/zh-hans/2.1/intro/contributing/#running-django-s-test-suite-for-the-first-time)
    - [尝试搞定一项新功能](/zh-hans/2.1/intro/contributing/#working-on-a-feature)
    - [为你的补丁创建一个分支](/zh-hans/2.1/intro/contributing/#creating-a-branch-for-your-patch)
    - [为你的工单写一些测试用例](/zh-hans/2.1/intro/contributing/#writing-some-tests-for-your-ticket)
    - [为你的工单编写代码](/zh-hans/2.1/intro/contributing/#writing-the-code-for-your-ticket)
    - [第二次运行 Django 测试套件](/zh-hans/2.1/intro/contributing/#running-django-s-test-suite-for-the-second-time)
    - [书写文档](/zh-hans/2.1/intro/contributing/#writing-documentation)
    - [预览你的修改](/zh-hans/2.1/intro/contributing/#previewing-your-changes)
    - [提交补丁中的修改](/zh-hans/2.1/intro/contributing/#committing-the-changes-in-the-patch)
    - [推送这次提交并生成一个 pull 请求](/zh-hans/2.1/intro/contributing/#pushing-the-commit-and-making-a-pull-request)
    - [下一步](/zh-hans/2.1/intro/contributing/#next-steps)
- [Using Django](/zh-hans/2.1/topics/)

  - [如何安装Django](/zh-hans/2.1/topics/install/)

    - [安装Python](/zh-hans/2.1/topics/install/#install-python)
    - [安装Apache和 `mod_wsgi`](/zh-hans/2.1/topics/install/#install-apache-and-mod-wsgi)
    - [运行你的数据库](/zh-hans/2.1/topics/install/#get-your-database-running)
    - [安装Django代码](/zh-hans/2.1/topics/install/#install-the-django-code)
  - [模型和数据库](/zh-hans/2.1/topics/db/)

    - [模型](/zh-hans/2.1/topics/db/models/)
    - [进行查询](/zh-hans/2.1/topics/db/queries/)
    - [聚合](/zh-hans/2.1/topics/db/aggregation/)
    - [搜索](/zh-hans/2.1/topics/db/search/)
    - [Managers](/zh-hans/2.1/topics/db/managers/)
    - [Performing raw SQL queries](/zh-hans/2.1/topics/db/sql/)
    - [数据库事务](/zh-hans/2.1/topics/db/transactions/)
    - [Multiple databases](/zh-hans/2.1/topics/db/multi-db/)
    - [Tablespaces](/zh-hans/2.1/topics/db/tablespaces/)
    - [Database access optimization](/zh-hans/2.1/topics/db/optimization/)
    - [Database instrumentation](/zh-hans/2.1/topics/db/instrumentation/)
    - [Examples of model relationship API usage](/zh-hans/2.1/topics/db/examples/)
  - [处理 HTTP 请求](/zh-hans/2.1/topics/http/)

    - [URL调度器](/zh-hans/2.1/topics/http/urls/)
    - [Writing views](/zh-hans/2.1/topics/http/views/)
    - [View decorators](/zh-hans/2.1/topics/http/decorators/)
    - [文件上传](/zh-hans/2.1/topics/http/file-uploads/)
    - [Django快捷函数](/zh-hans/2.1/topics/http/shortcuts/)
    - [通用视图](/zh-hans/2.1/topics/http/generic-views/)
    - [中间件](/zh-hans/2.1/topics/http/middleware/)
    - [如何使用会话](/zh-hans/2.1/topics/http/sessions/)
  - [使用表单](/zh-hans/2.1/topics/forms/)

    - [HTML表单](/zh-hans/2.1/topics/forms/#html-forms)
    - [Django在表单中的角色](/zh-hans/2.1/topics/forms/#django-s-role-in-forms)
    - [Django 中的表单](/zh-hans/2.1/topics/forms/#forms-in-django)
    - [构建一张表单](/zh-hans/2.1/topics/forms/#building-a-form)
    - [详解Django `Form` 类](/zh-hans/2.1/topics/forms/#more-about-django-form-classes)
    - [使用表单模板](/zh-hans/2.1/topics/forms/#working-with-form-templates)
    - [更多相关主题](/zh-hans/2.1/topics/forms/#further-topics)
  - [模板](/zh-hans/2.1/topics/templates/)

    - [模板引擎的支持](/zh-hans/2.1/topics/templates/#support-for-template-engines)
    - [The Django template language](/zh-hans/2.1/topics/templates/#the-django-template-language)
  - [基于类的视图](/zh-hans/2.1/topics/class-based-views/)

    - [基于类的视图](/zh-hans/2.1/topics/class-based-views/intro/)
    - [Built-in class-based generic views](/zh-hans/2.1/topics/class-based-views/generic-display/)
    - [Form handling with class-based views](/zh-hans/2.1/topics/class-based-views/generic-editing/)
    - [Using mixins with class-based views](/zh-hans/2.1/topics/class-based-views/mixins/)
    - [Basic examples](/zh-hans/2.1/topics/class-based-views/#basic-examples)
    - [Simple usage in your URLconf](/zh-hans/2.1/topics/class-based-views/#simple-usage-in-your-urlconf)
    - [Subclassing generic views](/zh-hans/2.1/topics/class-based-views/#subclassing-generic-views)
  - [Migrations](/zh-hans/2.1/topics/migrations/)

    - [The Commands](/zh-hans/2.1/topics/migrations/#the-commands)
    - [Backend Support](/zh-hans/2.1/topics/migrations/#backend-support)
    - [Workflow](/zh-hans/2.1/topics/migrations/#workflow)
    - [Dependencies](/zh-hans/2.1/topics/migrations/#dependencies)
    - [Migration files](/zh-hans/2.1/topics/migrations/#migration-files)
    - [Adding migrations to apps](/zh-hans/2.1/topics/migrations/#adding-migrations-to-apps)
    - [Historical models](/zh-hans/2.1/topics/migrations/#historical-models)
    - [Considerations when removing model fields](/zh-hans/2.1/topics/migrations/#considerations-when-removing-model-fields)
    - [Data Migrations](/zh-hans/2.1/topics/migrations/#data-migrations)
    - [Squashing migrations](/zh-hans/2.1/topics/migrations/#squashing-migrations)
    - [Serializing values](/zh-hans/2.1/topics/migrations/#serializing-values)
    - [Supporting multiple Django versions](/zh-hans/2.1/topics/migrations/#supporting-multiple-django-versions)
  - [Managing files](/zh-hans/2.1/topics/files/)

    - [Using files in models](/zh-hans/2.1/topics/files/#using-files-in-models)
    - [The `File` object](/zh-hans/2.1/topics/files/#the-file-object)
    - [File storage](/zh-hans/2.1/topics/files/#file-storage)
  - [Testing in Django](/zh-hans/2.1/topics/testing/)

    - [Writing and running tests](/zh-hans/2.1/topics/testing/overview/)
    - [Testing tools](/zh-hans/2.1/topics/testing/tools/)
    - [Advanced testing topics](/zh-hans/2.1/topics/testing/advanced/)
  - [Django中的用户认证](/zh-hans/2.1/topics/auth/)

    - [概况](/zh-hans/2.1/topics/auth/#overview)
    - [安装](/zh-hans/2.1/topics/auth/#installation)
    - [Usage](/zh-hans/2.1/topics/auth/#usage)
  - [Django's cache framework](/zh-hans/2.1/topics/cache/)

    - [Setting up the cache](/zh-hans/2.1/topics/cache/#setting-up-the-cache)
    - [The per-site cache](/zh-hans/2.1/topics/cache/#the-per-site-cache)
    - [The per-view cache](/zh-hans/2.1/topics/cache/#the-per-view-cache)
    - [Template fragment caching](/zh-hans/2.1/topics/cache/#template-fragment-caching)
    - [The low-level cache API](/zh-hans/2.1/topics/cache/#the-low-level-cache-api)
    - [下游缓存](/zh-hans/2.1/topics/cache/#downstream-caches)
    - [使用 `Vary` 标头](/zh-hans/2.1/topics/cache/#using-vary-headers)
    - [使用其他标头控制高速缓存](/zh-hans/2.1/topics/cache/#controlling-cache-using-other-headers)
    - [ \`\`MIDDLEWARE\`\`顺序](/zh-hans/2.1/topics/cache/#order-of-middleware)
  - [Conditional View Processing](/zh-hans/2.1/topics/conditional-view-processing/)

    - [The `condition` decorator](/zh-hans/2.1/topics/conditional-view-processing/#the-condition-decorator)
    - [Shortcuts for only computing one value](/zh-hans/2.1/topics/conditional-view-processing/#shortcuts-for-only-computing-one-value)
    - [Using the decorators with other HTTP methods](/zh-hans/2.1/topics/conditional-view-processing/#using-the-decorators-with-other-http-methods)
    - [Comparison with middleware conditional processing](/zh-hans/2.1/topics/conditional-view-processing/#comparison-with-middleware-conditional-processing)
  - [Cryptographic signing](/zh-hans/2.1/topics/signing/)

    - [Protecting the `SECRET_KEY`](/zh-hans/2.1/topics/signing/#protecting-the-secret-key)
    - [Using the low-level API](/zh-hans/2.1/topics/signing/#using-the-low-level-api)
  - [Sending email](/zh-hans/2.1/topics/email/)

    - [快速上手](/zh-hans/2.1/topics/email/#quick-example)
    - [`send_mail()`](/zh-hans/2.1/topics/email/#send-mail)
    - [`send_mass_mail()`](/zh-hans/2.1/topics/email/#send-mass-mail)
    - [`mail_admins()`](/zh-hans/2.1/topics/email/#mail-admins)
    - [`mail_managers()`](/zh-hans/2.1/topics/email/#mail-managers)
    - [示例](/zh-hans/2.1/topics/email/#examples)
    - [Preventing header injection](/zh-hans/2.1/topics/email/#preventing-header-injection)
    - [The `EmailMessage` class](/zh-hans/2.1/topics/email/#the-emailmessage-class)
    - [Email backends](/zh-hans/2.1/topics/email/#email-backends)
    - [Configuring email for development](/zh-hans/2.1/topics/email/#configuring-email-for-development)
  - [国际化和本地化](/zh-hans/2.1/topics/i18n/)

    - [概况](/zh-hans/2.1/topics/i18n/#overview)
    - [Definitions](/zh-hans/2.1/topics/i18n/#definitions)
  - [日志](/zh-hans/2.1/topics/logging/)

    - [日志管理快速入门](/zh-hans/2.1/topics/logging/#a-quick-logging-primer)
    - [使用 logging 模块](/zh-hans/2.1/topics/logging/#using-logging)
    - [日志模块的配置](/zh-hans/2.1/topics/logging/#configuring-logging)
    - [Django's logging extensions](/zh-hans/2.1/topics/logging/#django-s-logging-extensions)
    - [Django's default logging configuration](/zh-hans/2.1/topics/logging/#django-s-default-logging-configuration)
  - [分页](/zh-hans/2.1/topics/pagination/)

    - [例如](/zh-hans/2.1/topics/pagination/#example)
    - [在视图中使用 `Paginator`](/zh-hans/2.1/topics/pagination/#using-paginator-in-a-view)
    - [`Paginator` 对象](/zh-hans/2.1/topics/pagination/#paginator-objects)
    - [`InvalidPage` exceptions](/zh-hans/2.1/topics/pagination/#invalidpage-exceptions)
    - [`Page` objects](/zh-hans/2.1/topics/pagination/#page-objects)
  - [Security in Django](/zh-hans/2.1/topics/security/)

    - [Cross site scripting (XSS) protection](/zh-hans/2.1/topics/security/#cross-site-scripting-xss-protection)
    - [Cross site request forgery (CSRF) protection](/zh-hans/2.1/topics/security/#cross-site-request-forgery-csrf-protection)
    - [SQL injection protection](/zh-hans/2.1/topics/security/#sql-injection-protection)
    - [Clickjacking protection](/zh-hans/2.1/topics/security/#clickjacking-protection)
    - [SSL/HTTPS](/zh-hans/2.1/topics/security/#ssl-https)
    - [Host header validation](/zh-hans/2.1/topics/security/#host-header-validation)
    - [Session security](/zh-hans/2.1/topics/security/#session-security)
    - [User-uploaded content](/zh-hans/2.1/topics/security/#user-uploaded-content)
    - [Additional security topics](/zh-hans/2.1/topics/security/#additional-security-topics)
  - [性能和优化](/zh-hans/2.1/topics/performance/)

    - [介绍](/zh-hans/2.1/topics/performance/#introduction)
    - [一般方法](/zh-hans/2.1/topics/performance/#general-approaches)
    - [Caching](/zh-hans/2.1/topics/performance/#caching)
    - [Understanding laziness](/zh-hans/2.1/topics/performance/#understanding-laziness)
    - [Databases](/zh-hans/2.1/topics/performance/#databases)
    - [HTTP performance](/zh-hans/2.1/topics/performance/#http-performance)
    - [Template performance](/zh-hans/2.1/topics/performance/#template-performance)
    - [Using different versions of available software](/zh-hans/2.1/topics/performance/#using-different-versions-of-available-software)
  - [Serializing Django objects](/zh-hans/2.1/topics/serialization/)

    - [Serializing data](/zh-hans/2.1/topics/serialization/#serializing-data)
    - [Deserializing data](/zh-hans/2.1/topics/serialization/#deserializing-data)
    - [Serialization formats](/zh-hans/2.1/topics/serialization/#serialization-formats)
    - [Natural keys](/zh-hans/2.1/topics/serialization/#natural-keys)
  - [Django settings](/zh-hans/2.1/topics/settings/)

    - [基础](/zh-hans/2.1/topics/settings/#the-basics)
    - [指定配置文件](/zh-hans/2.1/topics/settings/#designating-the-settings)
    - [默认配置](/zh-hans/2.1/topics/settings/#default-settings)
    - [在Python代码中使用settings](/zh-hans/2.1/topics/settings/#using-settings-in-python-code)
    - [运行时更改设置](/zh-hans/2.1/topics/settings/#altering-settings-at-runtime)
    - [安全](/zh-hans/2.1/topics/settings/#security)
    - [可用的配置项](/zh-hans/2.1/topics/settings/#available-settings)
    - [创建你自己的配置文件](/zh-hans/2.1/topics/settings/#creating-your-own-settings)
    - [Using settings without setting `DJANGO_SETTINGS_MODULE`](/zh-hans/2.1/topics/settings/#using-settings-without-setting-django-settings-module)
  - [信号](/zh-hans/2.1/topics/signals/)

    - [Listening to signals](/zh-hans/2.1/topics/signals/#listening-to-signals)
    - [Defining and sending signals](/zh-hans/2.1/topics/signals/#defining-and-sending-signals)
    - [Disconnecting signals](/zh-hans/2.1/topics/signals/#disconnecting-signals)
  - [系统检查框架](/zh-hans/2.1/topics/checks/)

    - [Writing your own checks](/zh-hans/2.1/topics/checks/#writing-your-own-checks)
  - [External packages](/zh-hans/2.1/topics/external-packages/)

    - [Localflavor](/zh-hans/2.1/topics/external-packages/#localflavor)
    - [注释(Comments)](/zh-hans/2.1/topics/external-packages/#comments)
    - [Formtools](/zh-hans/2.1/topics/external-packages/#formtools)
- ["How-to" guides](/zh-hans/2.1/howto/)

  - [使用 `REMOTE_USER` 进行身份验证](/zh-hans/2.1/howto/auth-remote-user/)

    - [配置](/zh-hans/2.1/howto/auth-remote-user/#configuration)
    - [仅在登录界面使用 `REMOTE_USER`](/zh-hans/2.1/howto/auth-remote-user/#using-remote-user-on-login-pages-only)
  - [编写自定义 `django-admin` 的命令](/zh-hans/2.1/howto/custom-management-commands/)

    - [接受可选参数](/zh-hans/2.1/howto/custom-management-commands/#accepting-optional-arguments)
    - [Management commands and locales](/zh-hans/2.1/howto/custom-management-commands/#management-commands-and-locales)
    - [测试中](/zh-hans/2.1/howto/custom-management-commands/#testing)
    - [覆盖命令](/zh-hans/2.1/howto/custom-management-commands/#overriding-commands)
    - [命令对象](/zh-hans/2.1/howto/custom-management-commands/#command-objects)
  - [编写自定义 model fields](/zh-hans/2.1/howto/custom-model-fields/)

    - [介绍](/zh-hans/2.1/howto/custom-model-fields/#introduction)
    - [背后的理论](/zh-hans/2.1/howto/custom-model-fields/#background-theory)
    - [编写一个 field 子类](/zh-hans/2.1/howto/custom-model-fields/#writing-a-field-subclass)
    - [编写一个 `FileField` 子类](/zh-hans/2.1/howto/custom-model-fields/#writing-a-filefield-subclass)
  - [自定义查找](/zh-hans/2.1/howto/custom-lookups/)

    - [一个简单的查找示例](/zh-hans/2.1/howto/custom-lookups/#a-simple-lookup-example)
    - [让我们举一个简单的转换器示例](/zh-hans/2.1/howto/custom-lookups/#a-simple-transformer-example)
    - [编写一个高效的 `abs__lt` 查找](/zh-hans/2.1/howto/custom-lookups/#writing-an-efficient-abs-lt-lookup)
    - [A bilateral transformer example](/zh-hans/2.1/howto/custom-lookups/#a-bilateral-transformer-example)
    - [为现有的查找编写代替实现](/zh-hans/2.1/howto/custom-lookups/#writing-alternative-implementations-for-existing-lookups)
    - [How Django determines the lookups and transforms which are used](/zh-hans/2.1/howto/custom-lookups/#how-django-determines-the-lookups-and-transforms-which-are-used)
  - [自定义模板（template）的标签（tags）和过滤器（filters）](/zh-hans/2.1/howto/custom-template-tags/)

    - [Code layout](/zh-hans/2.1/howto/custom-template-tags/#code-layout)
    - [编写自定义的模板过滤器](/zh-hans/2.1/howto/custom-template-tags/#writing-custom-template-filters)
    - [Writing custom template tags](/zh-hans/2.1/howto/custom-template-tags/#writing-custom-template-tags)
  - [编写一个自定义存储系统](/zh-hans/2.1/howto/custom-file-storage/)
  - [部署Django](/zh-hans/2.1/howto/deployment/)

    - [如何使用 WSGI 进行部署](/zh-hans/2.1/howto/deployment/wsgi/)
    - [部署清单](/zh-hans/2.1/howto/deployment/checklist/)
  - [升级 Django 到最新的版本](/zh-hans/2.1/howto/upgrade-version/)

    - [Required Reading](/zh-hans/2.1/howto/upgrade-version/#required-reading)
    - [Dependencies](/zh-hans/2.1/howto/upgrade-version/#dependencies)
    - [Resolving deprecation warnings](/zh-hans/2.1/howto/upgrade-version/#resolving-deprecation-warnings)
    - [安装](/zh-hans/2.1/howto/upgrade-version/#installation)
    - [测试中](/zh-hans/2.1/howto/upgrade-version/#testing)
    - [Deployment](/zh-hans/2.1/howto/upgrade-version/#deployment)
  - [发送错误](/zh-hans/2.1/howto/error-reporting/)

    - [通过邮件方式报告](/zh-hans/2.1/howto/error-reporting/#email-reports)
    - [Filtering error reports](/zh-hans/2.1/howto/error-reporting/#filtering-error-reports)
  - [为模型提供初始化的数据](/zh-hans/2.1/howto/initial-data/)

    - [Providing initial data with migrations](/zh-hans/2.1/howto/initial-data/#providing-initial-data-with-migrations)
    - [Providing data with fixtures](/zh-hans/2.1/howto/initial-data/#providing-data-with-fixtures)
  - [基于 Jython 的 Django](/zh-hans/2.1/howto/jython/)
  - [Integrating Django with a legacy database](/zh-hans/2.1/howto/legacy-databases/)

    - [Give Django your database parameters](/zh-hans/2.1/howto/legacy-databases/#give-django-your-database-parameters)
    - [Auto-generate the models](/zh-hans/2.1/howto/legacy-databases/#auto-generate-the-models)
    - [Install the core Django tables](/zh-hans/2.1/howto/legacy-databases/#install-the-core-django-tables)
    - [Test and tweak](/zh-hans/2.1/howto/legacy-databases/#test-and-tweak)
  - [Outputting CSV with Django](/zh-hans/2.1/howto/outputting-csv/)

    - [Using the Python CSV library](/zh-hans/2.1/howto/outputting-csv/#using-the-python-csv-library)
    - [Using the template system](/zh-hans/2.1/howto/outputting-csv/#using-the-template-system)
    - [Other text-based formats](/zh-hans/2.1/howto/outputting-csv/#other-text-based-formats)
  - [Outputting PDFs with Django](/zh-hans/2.1/howto/outputting-pdf/)

    - [Install ReportLab](/zh-hans/2.1/howto/outputting-pdf/#install-reportlab)
    - [Write your view](/zh-hans/2.1/howto/outputting-pdf/#write-your-view)
    - [Other formats](/zh-hans/2.1/howto/outputting-pdf/#other-formats)
  - [Overriding templates](/zh-hans/2.1/howto/overriding-templates/)

    - [Overriding from the project's templates directory](/zh-hans/2.1/howto/overriding-templates/#overriding-from-the-project-s-templates-directory)
    - [Overriding from an app's template directory](/zh-hans/2.1/howto/overriding-templates/#overriding-from-an-app-s-template-directory)
  - [Managing static files (e.g. images, JavaScript, CSS)](/zh-hans/2.1/howto/static-files/)

    - [Configuring static files](/zh-hans/2.1/howto/static-files/#configuring-static-files)
    - [Serving static files during development](/zh-hans/2.1/howto/static-files/#serving-static-files-during-development)
    - [Serving files uploaded by a user during development](/zh-hans/2.1/howto/static-files/#serving-files-uploaded-by-a-user-during-development)
    - [测试中](/zh-hans/2.1/howto/static-files/#testing)
    - [Deployment](/zh-hans/2.1/howto/static-files/#deployment)
    - [了解更多](/zh-hans/2.1/howto/static-files/#learn-more)
  - [Deploying static files](/zh-hans/2.1/howto/static-files/deployment/)

    - [Serving static files in production](/zh-hans/2.1/howto/static-files/deployment/#serving-static-files-in-production)
    - [了解更多](/zh-hans/2.1/howto/static-files/deployment/#learn-more)
  - [如何在Windows上安装Django](/zh-hans/2.1/howto/windows/)

    - [安装Python](/zh-hans/2.1/howto/windows/#install-python)
    - [关于 `pip`](/zh-hans/2.1/howto/windows/#about-pip)
    - [安装 `virtualenv` 和 `virtualenvwrapper`](/zh-hans/2.1/howto/windows/#install-virtualenv-and-virtualenvwrapper)
    - [安装Django](/zh-hans/2.1/howto/windows/#install-django)
    - [Common pitfalls](/zh-hans/2.1/howto/windows/#common-pitfalls)
  - [Writing database migrations](/zh-hans/2.1/howto/writing-migrations/)

    - [Data migrations and multiple databases](/zh-hans/2.1/howto/writing-migrations/#data-migrations-and-multiple-databases)
    - [Migrations that add unique fields](/zh-hans/2.1/howto/writing-migrations/#migrations-that-add-unique-fields)
    - [Controlling the order of migrations](/zh-hans/2.1/howto/writing-migrations/#controlling-the-order-of-migrations)
    - [在第三方应用程序中迁移数据](/zh-hans/2.1/howto/writing-migrations/#migrating-data-between-third-party-apps)
    - [将非托管模型变为托管的](/zh-hans/2.1/howto/writing-migrations/#changing-an-unmanaged-model-to-managed)
- [Django FAQ](/zh-hans/2.1/faq/)

  - [FAQ: 概述](/zh-hans/2.1/faq/general/)

    - [这个项目因何存在。](/zh-hans/2.1/faq/general/#why-does-this-project-exist)
    - [“Django”是什么意思，怎么发音？](/zh-hans/2.1/faq/general/#what-does-django-mean-and-how-do-you-pronounce-it)
    - [Django 稳定吗?](/zh-hans/2.1/faq/general/#is-django-stable)
    - [Django 可扩展吗?](/zh-hans/2.1/faq/general/#does-django-scale)
    - [谁在这背后？](/zh-hans/2.1/faq/general/#who-s-behind-this)
    - [哪些站点使用 Django?](/zh-hans/2.1/faq/general/#which-sites-use-django)
    - [Django 似乎是一个 MVC 框架，但是您将控制器称为“视图”，并视图称为“模板”。 为什么不使用标准命名？](/zh-hans/2.1/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names)
    - [\<Framework X\>可以做到\<feature Y\>--为什么 Django 不能呢？](/zh-hans/2.1/faq/general/#framework-x-does-feature-y-why-doesn-t-django)
    - [为什么你要从头开始写所有的 Django 项目，而不是使用其他 Python 库？](/zh-hans/2.1/faq/general/#why-did-you-write-all-of-django-from-scratch-instead-of-using-other-python-libraries)
    - [Django 是个内容管理系统(CMS)吗?](/zh-hans/2.1/faq/general/#is-django-a-content-management-system-cms)
    - [我如何下载 Django 文档进行离线阅读？](/zh-hans/2.1/faq/general/#how-can-i-download-the-django-documentation-to-read-it-offline)
    - [如何引用 Django？](/zh-hans/2.1/faq/general/#how-do-i-cite-django)
  - [FAQ：安装](/zh-hans/2.1/faq/install/)

    - [如何开始？](/zh-hans/2.1/faq/install/#how-do-i-get-started)
    - [使用Django，需要做好什么准备？](/zh-hans/2.1/faq/install/#what-are-django-s-prerequisites)
    - [我应该使用哪个版本的 Python 来配合 Django?](/zh-hans/2.1/faq/install/#what-python-version-can-i-use-with-django)
    - [我应该选用什么版本的 Python 来使用 Django ？](/zh-hans/2.1/faq/install/#what-python-version-should-i-use-with-django)
    - [我应该使用稳定版本还是开发版本？](/zh-hans/2.1/faq/install/#should-i-use-the-stable-version-or-development-version)
  - [FAQ: 使用Django](/zh-hans/2.1/faq/usage/)

    - [为什么我在导入 DJANGO\_SETTINGS\_MODULE 时收到错误提示？](/zh-hans/2.1/faq/usage/#why-do-i-get-an-error-about-importing-django-settings-module)
    - [我不喜欢 Django 的模板语言，能不能不使用它？](/zh-hans/2.1/faq/usage/#i-can-t-stand-your-template-language-do-i-have-to-use-it)
    - [我是否必须使用你的模型/数据库层？](/zh-hans/2.1/faq/usage/#do-i-have-to-use-your-model-database-layer)
    - [我要怎么使用图片和文件字段？](/zh-hans/2.1/faq/usage/#how-do-i-use-image-and-file-fields)
    - [我如何让一个变量可用于我的所有模板之中？](/zh-hans/2.1/faq/usage/#how-do-i-make-a-variable-available-to-all-my-templates)
  - [FAQ:获取帮助](/zh-hans/2.1/faq/help/)

    - [我该如何做 X？Y为什么不工作？我可以去哪里寻求帮助？](/zh-hans/2.1/faq/help/#how-do-i-do-x-why-doesn-t-y-work-where-can-i-go-to-get-help)
    - [为什么我的信息没有出现在 \`django-users\`上面？](/zh-hans/2.1/faq/help/#why-hasn-t-my-message-appeared-on-django-users)
    - [没人在 Django-users 邮件列表上回答我的问题！我应该怎么办呢？](/zh-hans/2.1/faq/help/#nobody-on-django-users-answered-my-question-what-should-i-do)
    - [我认为我找到了个bug！我应该做什么呢？](/zh-hans/2.1/faq/help/#i-think-i-ve-found-a-bug-what-should-i-do)
    - [我认为我已经发现了个安全问题！我应该做什么？](/zh-hans/2.1/faq/help/#i-think-i-ve-found-a-security-problem-what-should-i-do)
  - [FAQ：数据库和模型](/zh-hans/2.1/faq/models/)

    - [我该如何在Django运行的过程中看到SQL查询？](/zh-hans/2.1/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running)
    - [我可以让Django用一个之前已经存在的数据库吗？](/zh-hans/2.1/faq/models/#can-i-use-django-with-a-pre-existing-database)
    - [如果我对一个模型做了改动，我该如何去更新数据库？](/zh-hans/2.1/faq/models/#if-i-make-changes-to-a-model-how-do-i-update-the-database)
    - [Django支持多列主键吗？](/zh-hans/2.1/faq/models/#do-django-models-support-multiple-column-primary-keys)
    - [Django 支持 NoSQL 数据库吗？](/zh-hans/2.1/faq/models/#does-django-support-nosql-databases)
    - [如何将特定于数据库的选项添加到我的 CREATE TABLE 语句中，例如将 MylSAM 指定为表类型？](/zh-hans/2.1/faq/models/#how-do-i-add-database-specific-options-to-my-create-table-statements-such-as-specifying-myisam-as-the-table-type)
  - [FAQ: 管理](/zh-hans/2.1/faq/admin/)

    - [无法登录。当我输入有效的用户名和密码后，页面再跳转到登录页面，没有显示任何错误信息。](/zh-hans/2.1/faq/admin/#i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-just-brings-up-the-login-page-again-with-no-error-messages)
    - [我无法登陆。当我输入有效的用户名和密码后，它又跳转到了登录界面，并且显示一个“请输入正确的用户名和密码”的错误。](/zh-hans/2.1/faq/admin/#i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-brings-up-the-login-page-again-with-a-please-enter-a-correct-username-and-password-error)
    - [在管理面板中，如何将字段的值自动设置为最后编辑它的用户？](/zh-hans/2.1/faq/admin/#how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin)
    - [我们如何设定管理权限，以便对象只能由创建它们的用户进行编辑？](/zh-hans/2.1/faq/admin/#how-do-i-limit-admin-access-so-that-objects-can-only-be-edited-by-the-users-who-created-them)
    - [管理界面的 CSS 和图片在开发模式下正常加载，但是在使用 mod\_wsgi 进行部署的情况下却无法进行加载？](/zh-hans/2.1/faq/admin/#my-admin-site-css-and-images-showed-up-fine-using-the-development-server-but-they-re-not-displaying-when-using-mod-wsgi)
    - [我的“list\_filter”包含一个 ManyToManyField (多对多字段)，但过滤器不显示](/zh-hans/2.1/faq/admin/#my-list-filter-contains-a-manytomanyfield-but-the-filter-doesn-t-display)
    - [有些对象没有在管理中出现。](/zh-hans/2.1/faq/admin/#some-objects-aren-t-appearing-in-the-admin)
    - [如何个性化管理员后台接口的功能？](/zh-hans/2.1/faq/admin/#how-can-i-customize-the-functionality-of-the-admin-interface)
    - [动态生成的管理页面太丑了。我该怎么换掉它？](/zh-hans/2.1/faq/admin/#the-dynamically-generated-admin-site-is-ugly-how-can-i-change-it)
    - [Admin 适配了哪些浏览器？](/zh-hans/2.1/faq/admin/#what-browsers-are-supported-for-using-the-admin)
  - [FAQ: 贡献代码](/zh-hans/2.1/faq/contributing/)

    - [如何为 Django 贡献代码?](/zh-hans/2.1/faq/contributing/#how-can-i-get-started-contributing-code-to-django)
    - [我几周之前提交了一个工单系统 bug 的修复。为什么忽略我的提议？](/zh-hans/2.1/faq/contributing/#i-submitted-a-bug-fix-in-the-ticket-system-several-weeks-ago-why-are-you-ignoring-my-patch)
    - [何时以及如何提醒团队我所关注的补丁？](/zh-hans/2.1/faq/contributing/#when-and-how-might-i-remind-the-team-of-a-patch-i-care-about)
    - [但是我已经提醒你好几遍了，你依然继续忽略我的补丁！](/zh-hans/2.1/faq/contributing/#but-i-ve-reminded-you-several-times-and-you-keep-ignoring-my-patch)
  - [错误调试](/zh-hans/2.1/faq/troubleshooting/)

    - [运行\`\`django-admin\`\`时遇到的问题](/zh-hans/2.1/faq/troubleshooting/#problems-running-django-admin)
    - [杂项](/zh-hans/2.1/faq/troubleshooting/#miscellaneous)
- [API Reference](/zh-hans/2.1/ref/)

  - [Applications](/zh-hans/2.1/ref/applications/)

    - [Projects and applications](/zh-hans/2.1/ref/applications/#projects-and-applications)
    - [Configuring applications](/zh-hans/2.1/ref/applications/#configuring-applications)
    - [Application configuration](/zh-hans/2.1/ref/applications/#application-configuration)
    - [Application registry](/zh-hans/2.1/ref/applications/#application-registry)
    - [Initialization process](/zh-hans/2.1/ref/applications/#initialization-process)
  - [System check framework](/zh-hans/2.1/ref/checks/)

    - [API reference](/zh-hans/2.1/ref/checks/#api-reference)
    - [Builtin tags](/zh-hans/2.1/ref/checks/#builtin-tags)
    - [Core system checks](/zh-hans/2.1/ref/checks/#core-system-checks)
    - [`contrib` app checks](/zh-hans/2.1/ref/checks/#contrib-app-checks)
  - [Built-in class-based views API](/zh-hans/2.1/ref/class-based-views/)

    - [Base views](/zh-hans/2.1/ref/class-based-views/base/)
    - [Generic display views](/zh-hans/2.1/ref/class-based-views/generic-display/)
    - [Generic editing views](/zh-hans/2.1/ref/class-based-views/generic-editing/)
    - [Generic date views](/zh-hans/2.1/ref/class-based-views/generic-date-based/)
    - [Class-based views mixins](/zh-hans/2.1/ref/class-based-views/mixins/)
    - [Class-based generic views - flattened index](/zh-hans/2.1/ref/class-based-views/flattened-index/)
    - [Specification](/zh-hans/2.1/ref/class-based-views/#specification)
    - [Base vs Generic views](/zh-hans/2.1/ref/class-based-views/#base-vs-generic-views)
  - [Clickjacking Protection](/zh-hans/2.1/ref/clickjacking/)

    - [An example of clickjacking](/zh-hans/2.1/ref/clickjacking/#an-example-of-clickjacking)
    - [Preventing clickjacking](/zh-hans/2.1/ref/clickjacking/#preventing-clickjacking)
    - [How to use it](/zh-hans/2.1/ref/clickjacking/#how-to-use-it)
    - [Limitations](/zh-hans/2.1/ref/clickjacking/#limitations)
  - [`contrib` packages](/zh-hans/2.1/ref/contrib/)

    - [The Django admin site](/zh-hans/2.1/ref/contrib/admin/)
    - [`django.contrib.auth`](/zh-hans/2.1/ref/contrib/auth/)
    - [The contenttypes framework](/zh-hans/2.1/ref/contrib/contenttypes/)
    - [The flatpages app](/zh-hans/2.1/ref/contrib/flatpages/)
    - [GeoDjango](/zh-hans/2.1/ref/contrib/gis/)
    - [`django.contrib.humanize`](/zh-hans/2.1/ref/contrib/humanize/)
    - [The messages framework](/zh-hans/2.1/ref/contrib/messages/)
    - [`django.contrib.postgres`](/zh-hans/2.1/ref/contrib/postgres/)
    - [The redirects app](/zh-hans/2.1/ref/contrib/redirects/)
    - [The sitemap framework](/zh-hans/2.1/ref/contrib/sitemaps/)
    - [The "sites" framework](/zh-hans/2.1/ref/contrib/sites/)
    - [The `staticfiles` app](/zh-hans/2.1/ref/contrib/staticfiles/)
    - [The syndication feed framework](/zh-hans/2.1/ref/contrib/syndication/)
    - [`admin`](/zh-hans/2.1/ref/contrib/#admin)
    - [`auth`](/zh-hans/2.1/ref/contrib/#auth)
    - [`contenttypes`](/zh-hans/2.1/ref/contrib/#contenttypes)
    - [`flatpages`](/zh-hans/2.1/ref/contrib/#flatpages)
    - [`gis`](/zh-hans/2.1/ref/contrib/#gis)
    - [`humanize`](/zh-hans/2.1/ref/contrib/#humanize)
    - [`messages`](/zh-hans/2.1/ref/contrib/#messages)
    - [`postgres`](/zh-hans/2.1/ref/contrib/#postgres)
    - [`redirects`](/zh-hans/2.1/ref/contrib/#redirects)
    - [`sessions`](/zh-hans/2.1/ref/contrib/#sessions)
    - [`sites`](/zh-hans/2.1/ref/contrib/#sites)
    - [`sitemaps`](/zh-hans/2.1/ref/contrib/#sitemaps)
    - [`syndication`](/zh-hans/2.1/ref/contrib/#syndication)
    - [Other add-ons](/zh-hans/2.1/ref/contrib/#other-add-ons)
  - [Cross Site Request Forgery protection](/zh-hans/2.1/ref/csrf/)

    - [How to use it](/zh-hans/2.1/ref/csrf/#how-to-use-it)
    - [Rejected requests](/zh-hans/2.1/ref/csrf/#rejected-requests)
    - [How it works](/zh-hans/2.1/ref/csrf/#how-it-works)
    - [Caching](/zh-hans/2.1/ref/csrf/#caching)
    - [Testing](/zh-hans/2.1/ref/csrf/#testing)
    - [Limitations](/zh-hans/2.1/ref/csrf/#limitations)
    - [Edge cases](/zh-hans/2.1/ref/csrf/#edge-cases)
    - [Contrib and reusable apps](/zh-hans/2.1/ref/csrf/#contrib-and-reusable-apps)
    - [Settings](/zh-hans/2.1/ref/csrf/#settings)
    - [Frequently Asked Questions](/zh-hans/2.1/ref/csrf/#frequently-asked-questions)
  - [Databases](/zh-hans/2.1/ref/databases/)

    - [General notes](/zh-hans/2.1/ref/databases/#general-notes)
    - [PostgreSQL notes](/zh-hans/2.1/ref/databases/#postgresql-notes)
    - [MySQL notes](/zh-hans/2.1/ref/databases/#mysql-notes)
    - [SQLite notes](/zh-hans/2.1/ref/databases/#sqlite-notes)
    - [Oracle notes](/zh-hans/2.1/ref/databases/#oracle-notes)
    - [Using a 3rd-party database backend](/zh-hans/2.1/ref/databases/#using-a-3rd-party-database-backend)
  - [`django-admin` and `manage.py`](/zh-hans/2.1/ref/django-admin/)

    - [Usage](/zh-hans/2.1/ref/django-admin/#usage)
    - [Available commands](/zh-hans/2.1/ref/django-admin/#available-commands)
    - [Commands provided by applications](/zh-hans/2.1/ref/django-admin/#commands-provided-by-applications)
    - [Default options](/zh-hans/2.1/ref/django-admin/#default-options)
    - [Extra niceties](/zh-hans/2.1/ref/django-admin/#extra-niceties)
  - [Running management commands from your code](/zh-hans/2.1/ref/django-admin/#running-management-commands-from-your-code)

    - [Output redirection](/zh-hans/2.1/ref/django-admin/#output-redirection)
  - [Django Exceptions](/zh-hans/2.1/ref/exceptions/)

    - [Django Core Exceptions](/zh-hans/2.1/ref/exceptions/#module-django.core.exceptions)
    - [URL Resolver exceptions](/zh-hans/2.1/ref/exceptions/#url-resolver-exceptions)
    - [Database Exceptions](/zh-hans/2.1/ref/exceptions/#database-exceptions)
    - [Http Exceptions](/zh-hans/2.1/ref/exceptions/#http-exceptions)
    - [Transaction Exceptions](/zh-hans/2.1/ref/exceptions/#transaction-exceptions)
    - [Testing Framework Exceptions](/zh-hans/2.1/ref/exceptions/#testing-framework-exceptions)
    - [Python Exceptions](/zh-hans/2.1/ref/exceptions/#python-exceptions)
  - [File handling](/zh-hans/2.1/ref/files/)

    - [The `File` object](/zh-hans/2.1/ref/files/file/)
    - [File storage API](/zh-hans/2.1/ref/files/storage/)
    - [Uploaded Files and Upload Handlers](/zh-hans/2.1/ref/files/uploads/)
  - [Forms](/zh-hans/2.1/ref/forms/)

    - [The Forms API](/zh-hans/2.1/ref/forms/api/)
    - [Form fields](/zh-hans/2.1/ref/forms/fields/)
    - [Model Form Functions](/zh-hans/2.1/ref/forms/models/)
    - [Formset Functions](/zh-hans/2.1/ref/forms/formsets/)
    - [The form rendering API](/zh-hans/2.1/ref/forms/renderers/)
    - [Widgets](/zh-hans/2.1/ref/forms/widgets/)
    - [Form and field validation](/zh-hans/2.1/ref/forms/validation/)
  - [Middleware](/zh-hans/2.1/ref/middleware/)

    - [Available middleware](/zh-hans/2.1/ref/middleware/#available-middleware)
    - [Middleware ordering](/zh-hans/2.1/ref/middleware/#middleware-ordering)
  - [Migration Operations](/zh-hans/2.1/ref/migration-operations/)

    - [Schema Operations](/zh-hans/2.1/ref/migration-operations/#schema-operations)
    - [Special Operations](/zh-hans/2.1/ref/migration-operations/#special-operations)
    - [Writing your own](/zh-hans/2.1/ref/migration-operations/#writing-your-own)
  - [Models](/zh-hans/2.1/ref/models/)

    - [Model field reference](/zh-hans/2.1/ref/models/fields/)
    - [Field attribute reference](/zh-hans/2.1/ref/models/fields/#field-attribute-reference)
    - [Model index reference](/zh-hans/2.1/ref/models/indexes/)
    - [Model `_meta` API](/zh-hans/2.1/ref/models/meta/)
    - [Related objects reference](/zh-hans/2.1/ref/models/relations/)
    - [Model class reference](/zh-hans/2.1/ref/models/class/)
    - [Model `Meta` options](/zh-hans/2.1/ref/models/options/)
    - [Model instance reference](/zh-hans/2.1/ref/models/instances/)
    - [`QuerySet` API reference](/zh-hans/2.1/ref/models/querysets/)
    - [Lookup API reference](/zh-hans/2.1/ref/models/lookups/)
    - [Query Expressions](/zh-hans/2.1/ref/models/expressions/)
    - [Conditional Expressions](/zh-hans/2.1/ref/models/conditional-expressions/)
    - [Database Functions](/zh-hans/2.1/ref/models/database-functions/)
  - [Request and response objects](/zh-hans/2.1/ref/request-response/)

    - [Quick overview](/zh-hans/2.1/ref/request-response/#quick-overview)
    - [`HttpRequest` objects](/zh-hans/2.1/ref/request-response/#httprequest-objects)
    - [`QueryDict` objects](/zh-hans/2.1/ref/request-response/#querydict-objects)
    - [`HttpResponse` objects](/zh-hans/2.1/ref/request-response/#httpresponse-objects)
    - [`JsonResponse` objects](/zh-hans/2.1/ref/request-response/#jsonresponse-objects)
    - [`StreamingHttpResponse` objects](/zh-hans/2.1/ref/request-response/#streaminghttpresponse-objects)
    - [`FileResponse` objects](/zh-hans/2.1/ref/request-response/#fileresponse-objects)
  - [`SchemaEditor`](/zh-hans/2.1/ref/schema-editor/)

    - [Methods](/zh-hans/2.1/ref/schema-editor/#methods)
    - [Attributes](/zh-hans/2.1/ref/schema-editor/#attributes)
  - [Settings](/zh-hans/2.1/ref/settings/)

    - [Core Settings](/zh-hans/2.1/ref/settings/#core-settings)
    - [Auth](/zh-hans/2.1/ref/settings/#auth)
    - [Messages](/zh-hans/2.1/ref/settings/#messages)
    - [Sessions](/zh-hans/2.1/ref/settings/#sessions)
    - [Sites](/zh-hans/2.1/ref/settings/#sites)
    - [Static Files](/zh-hans/2.1/ref/settings/#static-files)
    - [Core Settings Topical Index](/zh-hans/2.1/ref/settings/#core-settings-topical-index)
  - [Signals](/zh-hans/2.1/ref/signals/)

    - [Model signals](/zh-hans/2.1/ref/signals/#module-django.db.models.signals)
    - [Management signals](/zh-hans/2.1/ref/signals/#management-signals)
    - [Request/response signals](/zh-hans/2.1/ref/signals/#module-django.core.signals)
    - [Test signals](/zh-hans/2.1/ref/signals/#module-django.test.signals)
    - [Database Wrappers](/zh-hans/2.1/ref/signals/#module-django.db.backends)
  - [Templates](/zh-hans/2.1/ref/templates/)

    - [The Django template language](/zh-hans/2.1/ref/templates/language/)
    - [Built-in template tags and filters](/zh-hans/2.1/ref/templates/builtins/)
    - [The Django template language: for Python programmers](/zh-hans/2.1/ref/templates/api/)
  - [`TemplateResponse` and `SimpleTemplateResponse`](/zh-hans/2.1/ref/template-response/)

    - [`SimpleTemplateResponse` objects](/zh-hans/2.1/ref/template-response/#simpletemplateresponse-objects)
    - [`TemplateResponse` objects](/zh-hans/2.1/ref/template-response/#templateresponse-objects)
    - [The rendering process](/zh-hans/2.1/ref/template-response/#the-rendering-process)
    - [Using `TemplateResponse` and `SimpleTemplateResponse`](/zh-hans/2.1/ref/template-response/#using-templateresponse-and-simpletemplateresponse)
  - [Unicode data](/zh-hans/2.1/ref/unicode/)

    - [Creating the database](/zh-hans/2.1/ref/unicode/#creating-the-database)
    - [General string handling](/zh-hans/2.1/ref/unicode/#general-string-handling)
    - [Models](/zh-hans/2.1/ref/unicode/#models)
    - [Templates](/zh-hans/2.1/ref/unicode/#templates)
    - [Files](/zh-hans/2.1/ref/unicode/#files)
    - [Form submission](/zh-hans/2.1/ref/unicode/#form-submission)
  - [`django.urls` utility functions](/zh-hans/2.1/ref/urlresolvers/)

    - [`reverse()`](/zh-hans/2.1/ref/urlresolvers/#reverse)
    - [`reverse_lazy()`](/zh-hans/2.1/ref/urlresolvers/#reverse-lazy)
    - [`resolve()`](/zh-hans/2.1/ref/urlresolvers/#resolve)
    - [`get_script_prefix()`](/zh-hans/2.1/ref/urlresolvers/#get-script-prefix)
  - [`django.urls` functions for use in URLconfs](/zh-hans/2.1/ref/urls/)

    - [`path()`](/zh-hans/2.1/ref/urls/#path)
    - [`re_path()`](/zh-hans/2.1/ref/urls/#re-path)
    - [`include()`](/zh-hans/2.1/ref/urls/#include)
    - [`register_converter()`](/zh-hans/2.1/ref/urls/#register-converter)
  - [`django.conf.urls` functions for use in URLconfs](/zh-hans/2.1/ref/urls/#module-django.conf.urls)

    - [`static()`](/zh-hans/2.1/ref/urls/#static)
    - [`url()`](/zh-hans/2.1/ref/urls/#url)
    - [`handler400`](/zh-hans/2.1/ref/urls/#handler400)
    - [`handler403`](/zh-hans/2.1/ref/urls/#handler403)
    - [`handler404`](/zh-hans/2.1/ref/urls/#handler404)
    - [`handler500`](/zh-hans/2.1/ref/urls/#handler500)
  - [Django Utils](/zh-hans/2.1/ref/utils/)

    - [`django.utils.cache`](/zh-hans/2.1/ref/utils/#module-django.utils.cache)
    - [`django.utils.dateparse`](/zh-hans/2.1/ref/utils/#module-django.utils.dateparse)
    - [`django.utils.decorators`](/zh-hans/2.1/ref/utils/#module-django.utils.decorators)
    - [`django.utils.encoding`](/zh-hans/2.1/ref/utils/#module-django.utils.encoding)
    - [`django.utils.feedgenerator`](/zh-hans/2.1/ref/utils/#module-django.utils.feedgenerator)
    - [`django.utils.functional`](/zh-hans/2.1/ref/utils/#module-django.utils.functional)
    - [`django.utils.html`](/zh-hans/2.1/ref/utils/#module-django.utils.html)
    - [`django.utils.http`](/zh-hans/2.1/ref/utils/#module-django.utils.http)
    - [`django.utils.module_loading`](/zh-hans/2.1/ref/utils/#module-django.utils.module_loading)
    - [`django.utils.safestring`](/zh-hans/2.1/ref/utils/#module-django.utils.safestring)
    - [`django.utils.text`](/zh-hans/2.1/ref/utils/#module-django.utils.text)
    - [`django.utils.timezone`](/zh-hans/2.1/ref/utils/#module-django.utils.timezone)
    - [`django.utils.translation`](/zh-hans/2.1/ref/utils/#module-django.utils.translation)
  - [Validators](/zh-hans/2.1/ref/validators/)

    - [Writing validators](/zh-hans/2.1/ref/validators/#writing-validators)
    - [How validators are run](/zh-hans/2.1/ref/validators/#how-validators-are-run)
    - [Built-in validators](/zh-hans/2.1/ref/validators/#built-in-validators)
  - [Built-in Views](/zh-hans/2.1/ref/views/)

    - [Serving files in development](/zh-hans/2.1/ref/views/#serving-files-in-development)
    - [Error views](/zh-hans/2.1/ref/views/#error-views)
- [元文件和杂记](/zh-hans/2.1/misc/)

  - [API 的稳定性](/zh-hans/2.1/misc/api-stability/)

    - [什么是“稳定性”？](/zh-hans/2.1/misc/api-stability/#what-stable-means)
    - [稳定的API](/zh-hans/2.1/misc/api-stability/#stable-apis)
    - [例外](/zh-hans/2.1/misc/api-stability/#exceptions)
  - [设计理念](/zh-hans/2.1/misc/design-philosophies/)

    - [总体](/zh-hans/2.1/misc/design-philosophies/#overall)
    - [模型](/zh-hans/2.1/misc/design-philosophies/#models)
    - [数据库API](/zh-hans/2.1/misc/design-philosophies/#database-api)
    - [URL 设计](/zh-hans/2.1/misc/design-philosophies/#url-design)
    - [模板系统](/zh-hans/2.1/misc/design-philosophies/#template-system)
    - [视图](/zh-hans/2.1/misc/design-philosophies/#views)
    - [缓存框架](/zh-hans/2.1/misc/design-philosophies/#cache-framework)
  - [Django 的第三方发布包](/zh-hans/2.1/misc/distributions/)

    - [对于发布者](/zh-hans/2.1/misc/distributions/#for-distributors)
- [术语](/zh-hans/2.1/glossary/)
- [Release notes](/zh-hans/2.1/releases/)

  - [Final releases](/zh-hans/2.1/releases/#final-releases)

    - [2.1 release](/zh-hans/2.1/releases/#release)
    - [2.0 release](/zh-hans/2.1/releases/#id1)
    - [1.11 release](/zh-hans/2.1/releases/#id2)
    - [1.10 release](/zh-hans/2.1/releases/#id3)
    - [1.9 release](/zh-hans/2.1/releases/#id4)
    - [1.8 release](/zh-hans/2.1/releases/#id5)
    - [1.7 release](/zh-hans/2.1/releases/#id6)
    - [1.6 release](/zh-hans/2.1/releases/#id7)
    - [1.5 release](/zh-hans/2.1/releases/#id8)
    - [1.4 release](/zh-hans/2.1/releases/#id9)
    - [1.3 release](/zh-hans/2.1/releases/#id10)
    - [1.2 release](/zh-hans/2.1/releases/#id11)
    - [1.1 release](/zh-hans/2.1/releases/#id12)
    - [1.0 release](/zh-hans/2.1/releases/#id13)
    - [Pre-1.0 releases](/zh-hans/2.1/releases/#pre-1-0-releases)
  - [Security releases](/zh-hans/2.1/releases/#security-releases)
- [Django internals](/zh-hans/2.1/internals/)

  - [建设 Django](/zh-hans/2.1/internals/contributing/)

    - [对新贡献者的建议](/zh-hans/2.1/internals/contributing/new-contributors/)
    - [报告问题和请求新功能](/zh-hans/2.1/internals/contributing/bugs-and-features/)
    - [Triaging tickets](/zh-hans/2.1/internals/contributing/triaging-tickets/)
    - [Writing code](/zh-hans/2.1/internals/contributing/writing-code/)
    - [编写文档](/zh-hans/2.1/internals/contributing/writing-documentation/)
    - [使 Django 本地化](/zh-hans/2.1/internals/contributing/localizing/)
    - [提交代码](/zh-hans/2.1/internals/contributing/committing-code/)
  - [Mailing lists](/zh-hans/2.1/internals/mailing-lists/)

    - [`django-users`](/zh-hans/2.1/internals/mailing-lists/#django-users)
    - [`django-core-mentorship`](/zh-hans/2.1/internals/mailing-lists/#django-core-mentorship)
    - [`django-developers`](/zh-hans/2.1/internals/mailing-lists/#django-developers)
    - [`django-i18n`](/zh-hans/2.1/internals/mailing-lists/#django-i18n)
    - [`django-announce`](/zh-hans/2.1/internals/mailing-lists/#django-announce)
    - [`django-updates`](/zh-hans/2.1/internals/mailing-lists/#django-updates)
  - [Organization of the Django Project](/zh-hans/2.1/internals/organization/)

    - [Principles](/zh-hans/2.1/internals/organization/#principles)
    - [Core team](/zh-hans/2.1/internals/organization/#core-team)
    - [Technical board](/zh-hans/2.1/internals/organization/#technical-board)
    - [Changing the organization](/zh-hans/2.1/internals/organization/#changing-the-organization)
  - [Django's security policies](/zh-hans/2.1/internals/security/)

    - [Reporting security issues](/zh-hans/2.1/internals/security/#reporting-security-issues)
    - [Supported versions](/zh-hans/2.1/internals/security/#supported-versions)
    - [How Django discloses security issues](/zh-hans/2.1/internals/security/#how-django-discloses-security-issues)
    - [Who receives advance notification](/zh-hans/2.1/internals/security/#who-receives-advance-notification)
    - [Requesting notifications](/zh-hans/2.1/internals/security/#requesting-notifications)
  - [Django's release process](/zh-hans/2.1/internals/release-process/)

    - [Official releases](/zh-hans/2.1/internals/release-process/#official-releases)
    - [Release cadence](/zh-hans/2.1/internals/release-process/#release-cadence)
    - [Deprecation policy](/zh-hans/2.1/internals/release-process/#deprecation-policy)
    - [Supported versions](/zh-hans/2.1/internals/release-process/#supported-versions)
    - [Release process](/zh-hans/2.1/internals/release-process/#release-process)
  - [Django Deprecation Timeline](/zh-hans/2.1/internals/deprecation/)

    - [3.0](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-3-0)
    - [2.1](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-2-1)
    - [2.0](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-2-0)
    - [1.10](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-10)
    - [1.9](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-9)
    - [1.8](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-8)
    - [1.7](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-7)
    - [1.6](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-6)
    - [1.5](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-5)
    - [1.4](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-4)
    - [1.3](/zh-hans/2.1/internals/deprecation/#deprecation-removed-in-1-3)
  - [The Django source code repository](/zh-hans/2.1/internals/git/)

    - [High-level overview](/zh-hans/2.1/internals/git/#high-level-overview)
    - [The master branch](/zh-hans/2.1/internals/git/#the-master-branch)
    - [Other branches](/zh-hans/2.1/internals/git/#other-branches)
    - [标签(Tags)](/zh-hans/2.1/internals/git/#id1)
  - [How is Django Formed?](/zh-hans/2.1/internals/howto-release-django/)

    - [概况](/zh-hans/2.1/internals/howto-release-django/#overview)
    - [Prerequisites](/zh-hans/2.1/internals/howto-release-django/#prerequisites)
    - [Pre-release tasks](/zh-hans/2.1/internals/howto-release-django/#pre-release-tasks)
    - [Preparing for release](/zh-hans/2.1/internals/howto-release-django/#preparing-for-release)
    - [Actually rolling the release](/zh-hans/2.1/internals/howto-release-django/#actually-rolling-the-release)
    - [Making the release(s) available to the public](/zh-hans/2.1/internals/howto-release-django/#making-the-release-s-available-to-the-public)
    - [Post-release](/zh-hans/2.1/internals/howto-release-django/#post-release)
    - [New stable branch tasks](/zh-hans/2.1/internals/howto-release-django/#new-stable-branch-tasks)
    - [Notes on setting the VERSION tuple](/zh-hans/2.1/internals/howto-release-django/#notes-on-setting-the-version-tuple)

## 索引和词汇表

- [Index](/zh-hans/2.1/genindex/)
- [Module Index](/zh-hans/2.1/py-modindex/)
- [术语](/zh-hans/2.1/glossary/)
