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

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

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

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

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

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

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

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

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

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

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

    - [自定义后台表单](/zh-hans/5.1/intro/tutorial07/#customize-the-admin-form)
    - [添加关联的对象](/zh-hans/5.1/intro/tutorial07/#adding-related-objects)
    - [自定义后台更改列表](/zh-hans/5.1/intro/tutorial07/#customize-the-admin-change-list)
    - [自定义后台界面和风格](/zh-hans/5.1/intro/tutorial07/#customize-the-admin-look-and-feel)
    - [自定义后台主页](/zh-hans/5.1/intro/tutorial07/#customize-the-admin-index-page)
  - [编写你的第一个 Django 应用程序，第 8 部分](/zh-hans/5.1/intro/tutorial08/)

    - [安装 Django Debug Toolbar](/zh-hans/5.1/intro/tutorial08/#installing-django-debug-toolbar)
    - [寻求他人的帮助](/zh-hans/5.1/intro/tutorial08/#getting-help-from-others)
    - [安装其他第三方包](/zh-hans/5.1/intro/tutorial08/#installing-other-third-party-packages)
    - [接下来要做什么？](/zh-hans/5.1/intro/tutorial08/#what-s-next)
  - [进阶指南：如何编写可重用程序](/zh-hans/5.1/intro/reusable-apps/)

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

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

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

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

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

    - [模型](/zh-hans/5.1/topics/db/models/)
    - [执行查询](/zh-hans/5.1/topics/db/queries/)
    - [聚合](/zh-hans/5.1/topics/db/aggregation/)
    - [搜索](/zh-hans/5.1/topics/db/search/)
    - [管理器](/zh-hans/5.1/topics/db/managers/)
    - [执行原生 SQL 查询](/zh-hans/5.1/topics/db/sql/)
    - [数据库事务](/zh-hans/5.1/topics/db/transactions/)
    - [多数据库](/zh-hans/5.1/topics/db/multi-db/)
    - [表空间（Tablespaces）](/zh-hans/5.1/topics/db/tablespaces/)
    - [数据库访问优化](/zh-hans/5.1/topics/db/optimization/)
    - [数据库工具](/zh-hans/5.1/topics/db/instrumentation/)
    - [辅助工具](/zh-hans/5.1/topics/db/fixtures/)
    - [模型关联 API 用法示例](/zh-hans/5.1/topics/db/examples/)
  - [处理 HTTP 请求](/zh-hans/5.1/topics/http/)

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

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

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

    - [基于类的视图](/zh-hans/5.1/topics/class-based-views/intro/)
    - [内置的基于类的通用视图](/zh-hans/5.1/topics/class-based-views/generic-display/)
    - [使用基于类的视图处理表单](/zh-hans/5.1/topics/class-based-views/generic-editing/)
    - [在基于类的视图中使用混入](/zh-hans/5.1/topics/class-based-views/mixins/)
    - [基础示例](/zh-hans/5.1/topics/class-based-views/#basic-examples)
    - [在 URLconf 中的用法](/zh-hans/5.1/topics/class-based-views/#usage-in-your-urlconf)
    - [子类化通用视图](/zh-hans/5.1/topics/class-based-views/#subclassing-generic-views)
    - [异步类视图](/zh-hans/5.1/topics/class-based-views/#asynchronous-class-based-views)
  - [迁移](/zh-hans/5.1/topics/migrations/)

    - [命令](/zh-hans/5.1/topics/migrations/#the-commands)
    - [后端支持](/zh-hans/5.1/topics/migrations/#backend-support)
    - [工作流程](/zh-hans/5.1/topics/migrations/#workflow)
    - [事务](/zh-hans/5.1/topics/migrations/#transactions)
    - [依赖](/zh-hans/5.1/topics/migrations/#dependencies)
    - [迁移文件](/zh-hans/5.1/topics/migrations/#migration-files)
    - [向应用添加迁移](/zh-hans/5.1/topics/migrations/#adding-migrations-to-apps)
    - [撤销迁移](/zh-hans/5.1/topics/migrations/#reversing-migrations)
    - [历史模型](/zh-hans/5.1/topics/migrations/#historical-models)
    - [删除模型字段时的注意事项](/zh-hans/5.1/topics/migrations/#considerations-when-removing-model-fields)
    - [数据迁移](/zh-hans/5.1/topics/migrations/#data-migrations)
    - [压缩迁移](/zh-hans/5.1/topics/migrations/#squashing-migrations)
    - [序列化值](/zh-hans/5.1/topics/migrations/#serializing-values)
    - [支持多个 Django 版本](/zh-hans/5.1/topics/migrations/#supporting-multiple-django-versions)
  - [管理文件](/zh-hans/5.1/topics/files/)

    - [在模型中使用文件](/zh-hans/5.1/topics/files/#using-files-in-models)
    - [`File` 对象](/zh-hans/5.1/topics/files/#the-file-object)
    - [文件存储](/zh-hans/5.1/topics/files/#file-storage)
  - [Django 中的测试](/zh-hans/5.1/topics/testing/)

    - [编写并运行测试](/zh-hans/5.1/topics/testing/overview/)
    - [测试工具](/zh-hans/5.1/topics/testing/tools/)
    - [进阶测试主题](/zh-hans/5.1/topics/testing/advanced/)
  - [Django中的用户认证](/zh-hans/5.1/topics/auth/)

    - [概况](/zh-hans/5.1/topics/auth/#overview)
    - [安装](/zh-hans/5.1/topics/auth/#installation)
    - [用法](/zh-hans/5.1/topics/auth/#usage)
  - [Django 缓存框架](/zh-hans/5.1/topics/cache/)

    - [设置缓存](/zh-hans/5.1/topics/cache/#setting-up-the-cache)
    - [每站点缓存](/zh-hans/5.1/topics/cache/#the-per-site-cache)
    - [视图缓存](/zh-hans/5.1/topics/cache/#the-per-view-cache)
    - [模板片段缓存](/zh-hans/5.1/topics/cache/#template-fragment-caching)
    - [底层缓存 API](/zh-hans/5.1/topics/cache/#the-low-level-cache-api)
    - [异步支持](/zh-hans/5.1/topics/cache/#asynchronous-support)
    - [下游缓存](/zh-hans/5.1/topics/cache/#downstream-caches)
    - [使用 `Vary` 标头](/zh-hans/5.1/topics/cache/#using-vary-headers)
    - [使用其他标头控制高速缓存](/zh-hans/5.1/topics/cache/#controlling-cache-using-other-headers)
    - [`MIDDLEWARE` 顺序](/zh-hans/5.1/topics/cache/#order-of-middleware)
  - [条件视图处理](/zh-hans/5.1/topics/conditional-view-processing/)

    - [条件装饰器](/zh-hans/5.1/topics/conditional-view-processing/#the-condition-decorator)
    - [仅用于计算一个值的快捷方式](/zh-hans/5.1/topics/conditional-view-processing/#shortcuts-for-only-computing-one-value)
    - [将装饰器和其他 HTTP 方法一起使用](/zh-hans/5.1/topics/conditional-view-processing/#using-the-decorators-with-other-http-methods)
    - [对比中间件的条件处理](/zh-hans/5.1/topics/conditional-view-processing/#comparison-with-middleware-conditional-processing)
  - [加密签名](/zh-hans/5.1/topics/signing/)

    - [保护 `SECRET_KEY` 和 `SECRET_KEY_FALLBACKS`](/zh-hans/5.1/topics/signing/#protecting-secret-key-and-secret-key-fallbacks)
    - [使用低级 API](/zh-hans/5.1/topics/signing/#using-the-low-level-api)
  - [发送邮件](/zh-hans/5.1/topics/email/)

    - [快速示例](/zh-hans/5.1/topics/email/#quick-examples)
    - [`send_mail()`](/zh-hans/5.1/topics/email/#send-mail)
    - [`send_mass_mail()`](/zh-hans/5.1/topics/email/#send-mass-mail)
    - [`mail_admins()`](/zh-hans/5.1/topics/email/#mail-admins)
    - [`mail_managers()`](/zh-hans/5.1/topics/email/#mail-managers)
    - [示例](/zh-hans/5.1/topics/email/#examples)
    - [防止头注入](/zh-hans/5.1/topics/email/#preventing-header-injection)
    - [`EmailMessage` 类](/zh-hans/5.1/topics/email/#the-emailmessage-class)
    - [邮件后端](/zh-hans/5.1/topics/email/#email-backends)
    - [为了开发配置邮件](/zh-hans/5.1/topics/email/#configuring-email-for-development)
  - [国际化和本地化](/zh-hans/5.1/topics/i18n/)

    - [概况](/zh-hans/5.1/topics/i18n/#overview)
    - [定义](/zh-hans/5.1/topics/i18n/#definitions)
  - [日志](/zh-hans/5.1/topics/logging/)

    - [概况](/zh-hans/5.1/topics/logging/#overview)
    - [安全性考虑](/zh-hans/5.1/topics/logging/#security-implications)
    - [日志模块的配置](/zh-hans/5.1/topics/logging/#configuring-logging)
  - [分页](/zh-hans/5.1/topics/pagination/)

    - [`Paginator` 类](/zh-hans/5.1/topics/pagination/#the-paginator-class)
    - [例如](/zh-hans/5.1/topics/pagination/#example)
    - [`ListView` 分页](/zh-hans/5.1/topics/pagination/#paginating-a-listview)
    - [在视图函数中使用 `Paginator`](/zh-hans/5.1/topics/pagination/#using-paginator-in-a-view-function)
  - [Django 的安全性](/zh-hans/5.1/topics/security/)

    - [Always sanitize user input](/zh-hans/5.1/topics/security/#always-sanitize-user-input)
    - [防御跨站脚本攻击（XSS）](/zh-hans/5.1/topics/security/#cross-site-scripting-xss-protection)
    - [防御跨站点请求伪造（CSRF）](/zh-hans/5.1/topics/security/#cross-site-request-forgery-csrf-protection)
    - [防御 SQL 注入](/zh-hans/5.1/topics/security/#sql-injection-protection)
    - [防御访问劫持](/zh-hans/5.1/topics/security/#clickjacking-protection)
    - [SSL/HTTPS](/zh-hans/5.1/topics/security/#ssl-https)
    - [Host 头部验证](/zh-hans/5.1/topics/security/#host-header-validation)
    - [Referrer 策略](/zh-hans/5.1/topics/security/#referrer-policy)
    - [跨源弹出式窗口策略](/zh-hans/5.1/topics/security/#cross-origin-opener-policy)
    - [会话安全](/zh-hans/5.1/topics/security/#session-security)
    - [用户上传内容](/zh-hans/5.1/topics/security/#user-uploaded-content)
    - [其他安全性相关主题](/zh-hans/5.1/topics/security/#additional-security-topics)
  - [性能和优化](/zh-hans/5.1/topics/performance/)

    - [介绍](/zh-hans/5.1/topics/performance/#introduction)
    - [一般方法](/zh-hans/5.1/topics/performance/#general-approaches)
    - [缓存](/zh-hans/5.1/topics/performance/#caching)
    - [理解惰性](/zh-hans/5.1/topics/performance/#understanding-laziness)
    - [数据库](/zh-hans/5.1/topics/performance/#databases)
    - [HTTP 性能](/zh-hans/5.1/topics/performance/#http-performance)
    - [模板性能](/zh-hans/5.1/topics/performance/#template-performance)
    - [使用现有软件的不同版本](/zh-hans/5.1/topics/performance/#using-different-versions-of-available-software)
  - [序列化 Django 对象](/zh-hans/5.1/topics/serialization/)

    - [序列化数据](/zh-hans/5.1/topics/serialization/#serializing-data)
    - [反序列化数据](/zh-hans/5.1/topics/serialization/#deserializing-data)
    - [序列化格式](/zh-hans/5.1/topics/serialization/#serialization-formats)
    - [自然键](/zh-hans/5.1/topics/serialization/#natural-keys)
  - [Django 配置](/zh-hans/5.1/topics/settings/)

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

    - [监听信号](/zh-hans/5.1/topics/signals/#listening-to-signals)
    - [定义和发送信号](/zh-hans/5.1/topics/signals/#defining-and-sending-signals)
    - [断开信号](/zh-hans/5.1/topics/signals/#disconnecting-signals)
  - [系统检查框架](/zh-hans/5.1/topics/checks/)

    - [编写自定义的检查](/zh-hans/5.1/topics/checks/#writing-your-own-checks)
  - [扩展包](/zh-hans/5.1/topics/external-packages/)

    - [Localflavor](/zh-hans/5.1/topics/external-packages/#localflavor)
    - [Comments](/zh-hans/5.1/topics/external-packages/#comments)
    - [Formtools](/zh-hans/5.1/topics/external-packages/#formtools)
  - [异步支持](/zh-hans/5.1/topics/async/)

    - [异步视图](/zh-hans/5.1/topics/async/#async-views)
    - [异步安全](/zh-hans/5.1/topics/async/#async-safety)
    - [异步适配函数](/zh-hans/5.1/topics/async/#async-adapter-functions)
- [如何引导](/zh-hans/5.1/howto/)

  - [模型，数据和数据库](/zh-hans/5.1/howto/#models-data-and-databases)

    - [如何为模型提供初始数据](/zh-hans/5.1/howto/initial-data/)
    - [如何将 Django 与旧有的数据库集成](/zh-hans/5.1/howto/legacy-databases/)
    - [编写自定义模型字段](/zh-hans/5.1/howto/custom-model-fields/)
    - [如何创建数据库迁移](/zh-hans/5.1/howto/writing-migrations/)
    - [如何编写自定义的查询器](/zh-hans/5.1/howto/custom-lookups/)
  - [模板和输出](/zh-hans/5.1/howto/#templates-and-output)

    - [如何输出 CSV](/zh-hans/5.1/howto/outputting-csv/)
    - [如何创建 PDF 文件](/zh-hans/5.1/howto/outputting-pdf/)
    - [如何覆盖模板](/zh-hans/5.1/howto/overriding-templates/)
    - [如何编写一个自定义的模板后端](/zh-hans/5.1/howto/custom-template-backend/)
    - [如何编写自定义的模板标签和过滤器](/zh-hans/5.1/howto/custom-template-tags/)
  - [项目配置和管理](/zh-hans/5.1/howto/#project-configuration-and-management)

    - [如何管理静态文件（如图片、JavaScript、CSS）](/zh-hans/5.1/howto/static-files/)
    - [如何配置和使用日志](/zh-hans/5.1/howto/logging/)
    - [如何管理错误报告](/zh-hans/5.1/howto/error-reporting/)
    - [如何删除一个 Django 应用](/zh-hans/5.1/howto/delete-app/)
  - [安装、部署和升级](/zh-hans/5.1/howto/#installing-deploying-and-upgrading)

    - [如何将 Django 更新至新的版本](/zh-hans/5.1/howto/upgrade-version/)
    - [如何在 Windows 上安装 Django](/zh-hans/5.1/howto/windows/)
    - [如何部署 Django](/zh-hans/5.1/howto/deployment/)
    - [如何部署静态文件](/zh-hans/5.1/howto/static-files/deployment/)
  - [其他指导](/zh-hans/5.1/howto/#other-guides)

    - [使用 `REMOTE_USER` 进行身份验证](/zh-hans/5.1/howto/auth-remote-user/)
    - [如何使用 Django 提供的 CSRF 防护功能](/zh-hans/5.1/howto/csrf/)
    - [编写自定义 `django-admin` 命令](/zh-hans/5.1/howto/custom-management-commands/)
    - [如何编写一个自定义的文件存储类](/zh-hans/5.1/howto/custom-file-storage/)
- [Django FAQ](/zh-hans/5.1/faq/)

  - [FAQ：概述](/zh-hans/5.1/faq/general/)

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

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

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

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

    - [我该如何在Django运行的过程中看到SQL查询？](/zh-hans/5.1/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running)
    - [我可以让 Django 使用一个已经存在的数据库吗？](/zh-hans/5.1/faq/models/#can-i-use-django-with-a-preexisting-database)
    - [如果我对一个模型做了改动，我该如何去更新数据库？](/zh-hans/5.1/faq/models/#if-i-make-changes-to-a-model-how-do-i-update-the-database)
    - [Django 支持多列主键吗？](/zh-hans/5.1/faq/models/#do-django-models-support-multiple-column-primary-keys)
    - [Django 支持 NoSQL 数据库吗？](/zh-hans/5.1/faq/models/#does-django-support-nosql-databases)
    - [如何将特定于数据库的选项添加到我的 CREATE TABLE 语句中，例如将 MylSAM 指定为表类型？](/zh-hans/5.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/5.1/faq/admin/)

    - [无法登录。当我输入有效的用户名和密码后，页面再跳转到登录页面，没有显示任何错误信息。](/zh-hans/5.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/5.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/5.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/5.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/5.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/5.1/faq/admin/#my-list-filter-contains-a-manytomanyfield-but-the-filter-doesn-t-display)
    - [有些对象没有在管理中出现。](/zh-hans/5.1/faq/admin/#some-objects-aren-t-appearing-in-the-admin)
    - [如何个性化管理员后台接口的功能？](/zh-hans/5.1/faq/admin/#how-can-i-customize-the-functionality-of-the-admin-interface)
    - [动态生成的管理页面太丑了。我该怎么换掉它？](/zh-hans/5.1/faq/admin/#the-dynamically-generated-admin-site-is-ugly-how-can-i-change-it)
    - [Admin 适配了哪些浏览器？](/zh-hans/5.1/faq/admin/#what-browsers-are-supported-for-using-the-admin)
    - [什么辅助技术支持使用管理界面？](/zh-hans/5.1/faq/admin/#what-assistive-technologies-are-supported-for-using-the-admin)
  - [FAQ：贡献代码](/zh-hans/5.1/faq/contributing/)

    - [如何为 Django 贡献代码?](/zh-hans/5.1/faq/contributing/#how-can-i-get-started-contributing-code-to-django)
    - [几周前我提交了一个错误修复。为什么你们不理睬我的贡献？](/zh-hans/5.1/faq/contributing/#i-submitted-a-bug-fix-several-weeks-ago-why-are-you-ignoring-my-contribution)
    - [何时以及以何种方式提醒团队我关心的更改？](/zh-hans/5.1/faq/contributing/#when-and-how-might-i-remind-the-team-of-a-change-i-care-about)
    - [但我已经提醒了你好几次，你仍然无视我的贡献！](/zh-hans/5.1/faq/contributing/#but-i-ve-reminded-you-several-times-and-you-keep-ignoring-my-contribution)
    - [我肯定我的工单百分之100绝对完成了，那么就能说我把这个工单认定为 ”通过批准" 了吗？](/zh-hans/5.1/faq/contributing/#i-m-sure-my-ticket-is-absolutely-100-perfect-can-i-mark-it-as-ready-for-checkin-myself)
  - [错误调试](/zh-hans/5.1/faq/troubleshooting/)

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

  - [应用程序](/zh-hans/5.1/ref/applications/)

    - [项目和应用程序](/zh-hans/5.1/ref/applications/#projects-and-applications)
    - [配置应用程序](/zh-hans/5.1/ref/applications/#configuring-applications)
    - [应用程序配置](/zh-hans/5.1/ref/applications/#application-configuration)
    - [应用程序注册表](/zh-hans/5.1/ref/applications/#application-registry)
    - [初始化进程](/zh-hans/5.1/ref/applications/#initialization-process)
  - [系统检查框架](/zh-hans/5.1/ref/checks/)

    - [API 参考](/zh-hans/5.1/ref/checks/#api-reference)
    - [内置标签](/zh-hans/5.1/ref/checks/#builtin-tags)
    - [核心系统检查](/zh-hans/5.1/ref/checks/#core-system-checks)
    - [`contrib` 应用检查](/zh-hans/5.1/ref/checks/#contrib-app-checks)
  - [内置基于类的视图 API](/zh-hans/5.1/ref/class-based-views/)

    - [基础视图](/zh-hans/5.1/ref/class-based-views/base/)
    - [通用显示视图](/zh-hans/5.1/ref/class-based-views/generic-display/)
    - [通用编辑视图](/zh-hans/5.1/ref/class-based-views/generic-editing/)
    - [通用日期视图](/zh-hans/5.1/ref/class-based-views/generic-date-based/)
    - [基于类的视图混入](/zh-hans/5.1/ref/class-based-views/mixins/)
    - [基于类的通用视图——扁平化索引](/zh-hans/5.1/ref/class-based-views/flattened-index/)
    - [规范](/zh-hans/5.1/ref/class-based-views/#specification)
    - [基础 vs 通用视图](/zh-hans/5.1/ref/class-based-views/#base-vs-generic-views)
  - [点击劫持保护](/zh-hans/5.1/ref/clickjacking/)

    - [点击劫持的一个例子](/zh-hans/5.1/ref/clickjacking/#an-example-of-clickjacking)
    - [防止点击劫持](/zh-hans/5.1/ref/clickjacking/#preventing-clickjacking)
    - [如何使用它](/zh-hans/5.1/ref/clickjacking/#how-to-use-it)
    - [限制](/zh-hans/5.1/ref/clickjacking/#limitations)
  - [`contrib` 包](/zh-hans/5.1/ref/contrib/)

    - [Django 管理站点](/zh-hans/5.1/ref/contrib/admin/)
    - [`django.contrib.auth`](/zh-hans/5.1/ref/contrib/auth/)
    - [内容类型框架](/zh-hans/5.1/ref/contrib/contenttypes/)
    - [简单页面应用](/zh-hans/5.1/ref/contrib/flatpages/)
    - [GeoDjango](/zh-hans/5.1/ref/contrib/gis/)
    - [`django.contrib.humanize`](/zh-hans/5.1/ref/contrib/humanize/)
    - [消息框架](/zh-hans/5.1/ref/contrib/messages/)
    - [`django.contrib.postgres`](/zh-hans/5.1/ref/contrib/postgres/)
    - [重定向应用](/zh-hans/5.1/ref/contrib/redirects/)
    - [站点地图框架](/zh-hans/5.1/ref/contrib/sitemaps/)
    - [“站点”框架](/zh-hans/5.1/ref/contrib/sites/)
    - [`staticfiles` 应用](/zh-hans/5.1/ref/contrib/staticfiles/)
    - [Feed 聚合框架](/zh-hans/5.1/ref/contrib/syndication/)
    - [`admin`](/zh-hans/5.1/ref/contrib/#admin)
    - [`auth`](/zh-hans/5.1/ref/contrib/#auth)
    - [`contenttypes`](/zh-hans/5.1/ref/contrib/#contenttypes)
    - [`flatpages`](/zh-hans/5.1/ref/contrib/#flatpages)
    - [`gis`](/zh-hans/5.1/ref/contrib/#gis)
    - [`humanize`](/zh-hans/5.1/ref/contrib/#humanize)
    - [`messages`](/zh-hans/5.1/ref/contrib/#messages)
    - [`postgres`](/zh-hans/5.1/ref/contrib/#postgres)
    - [`redirects`](/zh-hans/5.1/ref/contrib/#redirects)
    - [`sessions`](/zh-hans/5.1/ref/contrib/#sessions)
    - [`sites`](/zh-hans/5.1/ref/contrib/#sites)
    - [`sitemaps`](/zh-hans/5.1/ref/contrib/#sitemaps)
    - [`syndication`](/zh-hans/5.1/ref/contrib/#syndication)
  - [跨站请求伪造保护](/zh-hans/5.1/ref/csrf/)

    - [工作方式](/zh-hans/5.1/ref/csrf/#how-it-works)
    - [限制](/zh-hans/5.1/ref/csrf/#limitations)
    - [实用程序](/zh-hans/5.1/ref/csrf/#module-django.views.decorators.csrf)
    - [配置](/zh-hans/5.1/ref/csrf/#settings)
    - [常问问题](/zh-hans/5.1/ref/csrf/#frequently-asked-questions)
  - [数据库](/zh-hans/5.1/ref/databases/)

    - [通用注意事项](/zh-hans/5.1/ref/databases/#general-notes)
    - [PostgreSQL 注意事项](/zh-hans/5.1/ref/databases/#postgresql-notes)
    - [MariaDB 注意事项](/zh-hans/5.1/ref/databases/#mariadb-notes)
    - [MySQL 注意事项](/zh-hans/5.1/ref/databases/#mysql-notes)
    - [SQLite 注意事项](/zh-hans/5.1/ref/databases/#sqlite-notes)
    - [Oracle 注意事项](/zh-hans/5.1/ref/databases/#oracle-notes)
    - [子类化内置数据库后端](/zh-hans/5.1/ref/databases/#subclassing-the-built-in-database-backends)
    - [使用第三方数据库后端](/zh-hans/5.1/ref/databases/#using-a-3rd-party-database-backend)
  - [`django-admin` 和 `manage.py`](/zh-hans/5.1/ref/django-admin/)

    - [用法](/zh-hans/5.1/ref/django-admin/#usage)
    - [可用命令](/zh-hans/5.1/ref/django-admin/#available-commands)
    - [应用程序提供的命令](/zh-hans/5.1/ref/django-admin/#commands-provided-by-applications)
    - [默认选项](/zh-hans/5.1/ref/django-admin/#default-options)
    - [额外的细节](/zh-hans/5.1/ref/django-admin/#extra-niceties)
  - [从你的代码中运行管理命令](/zh-hans/5.1/ref/django-admin/#running-management-commands-from-your-code)

    - [输出重定向](/zh-hans/5.1/ref/django-admin/#output-redirection)
  - [Django 异常](/zh-hans/5.1/ref/exceptions/)

    - [Django 核心异常](/zh-hans/5.1/ref/exceptions/#module-django.core.exceptions)
    - [URL 解析器异常](/zh-hans/5.1/ref/exceptions/#url-resolver-exceptions)
    - [数据库异常](/zh-hans/5.1/ref/exceptions/#database-exceptions)
    - [HTTP 异常](/zh-hans/5.1/ref/exceptions/#http-exceptions)
    - [会话异常](/zh-hans/5.1/ref/exceptions/#sessions-exceptions)
    - [事务异常](/zh-hans/5.1/ref/exceptions/#transaction-exceptions)
    - [测试框架异常](/zh-hans/5.1/ref/exceptions/#testing-framework-exceptions)
    - [Python 异常](/zh-hans/5.1/ref/exceptions/#python-exceptions)
  - [文件处理](/zh-hans/5.1/ref/files/)

    - [`File` 对象](/zh-hans/5.1/ref/files/file/)
    - [文件存储 API](/zh-hans/5.1/ref/files/storage/)
    - [上传的文件和上传处理程序](/zh-hans/5.1/ref/files/uploads/)
  - [表单](/zh-hans/5.1/ref/forms/)

    - [表单 API](/zh-hans/5.1/ref/forms/api/)
    - [表单字段](/zh-hans/5.1/ref/forms/fields/)
    - [模型表单函数](/zh-hans/5.1/ref/forms/models/)
    - [表单集函数](/zh-hans/5.1/ref/forms/formsets/)
    - [表单渲染 API](/zh-hans/5.1/ref/forms/renderers/)
    - [部件](/zh-hans/5.1/ref/forms/widgets/)
    - [表单和字段验证](/zh-hans/5.1/ref/forms/validation/)
  - [日志](/zh-hans/5.1/ref/logging/)

    - [Django 的默认日志配置](/zh-hans/5.1/ref/logging/#django-s-default-logging-configuration)
    - [Django 日志扩展](/zh-hans/5.1/ref/logging/#django-logging-extensions)
  - [中间件](/zh-hans/5.1/ref/middleware/)

    - [可用的中间件](/zh-hans/5.1/ref/middleware/#available-middleware)
    - [中间件顺序](/zh-hans/5.1/ref/middleware/#middleware-ordering)
  - [迁移操作](/zh-hans/5.1/ref/migration-operations/)

    - [架构操作](/zh-hans/5.1/ref/migration-operations/#schema-operations)
    - [特殊操作](/zh-hans/5.1/ref/migration-operations/#special-operations)
    - [操作类别](/zh-hans/5.1/ref/migration-operations/#operation-category)
    - [自己写](/zh-hans/5.1/ref/migration-operations/#writing-your-own)
  - [模型](/zh-hans/5.1/ref/models/)

    - [模型字段参考](/zh-hans/5.1/ref/models/fields/)
    - [字段属性参考](/zh-hans/5.1/ref/models/fields/#field-attribute-reference)
    - [模型索引参考](/zh-hans/5.1/ref/models/indexes/)
    - [约束参考](/zh-hans/5.1/ref/models/constraints/)
    - [模型 `_meta` API](/zh-hans/5.1/ref/models/meta/)
    - [关联对象参考](/zh-hans/5.1/ref/models/relations/)
    - [模型类参考](/zh-hans/5.1/ref/models/class/)
    - [模型 `Meta` 选项](/zh-hans/5.1/ref/models/options/)
    - [模型实例参考](/zh-hans/5.1/ref/models/instances/)
    - [`QuerySet` API 参考](/zh-hans/5.1/ref/models/querysets/)
    - [查找 API 参考](/zh-hans/5.1/ref/models/lookups/)
    - [查询表达式](/zh-hans/5.1/ref/models/expressions/)
    - [条件表达式](/zh-hans/5.1/ref/models/conditional-expressions/)
    - [数据库函数](/zh-hans/5.1/ref/models/database-functions/)
  - [分页器](/zh-hans/5.1/ref/paginator/)

    - [`Paginator` 类](/zh-hans/5.1/ref/paginator/#paginator-class)
    - [`Page` 类](/zh-hans/5.1/ref/paginator/#page-class)
    - [异常](/zh-hans/5.1/ref/paginator/#exceptions)
  - [请求和响应对象](/zh-hans/5.1/ref/request-response/)

    - [快速概述](/zh-hans/5.1/ref/request-response/#quick-overview)
    - [`HttpRequest` 对象](/zh-hans/5.1/ref/request-response/#httprequest-objects)
    - [`QueryDict` 对象](/zh-hans/5.1/ref/request-response/#querydict-objects)
    - [`HttpResponse` 对象](/zh-hans/5.1/ref/request-response/#httpresponse-objects)
    - [`JsonResponse` 对象](/zh-hans/5.1/ref/request-response/#jsonresponse-objects)
    - [`StreamingHttpResponse` 对象](/zh-hans/5.1/ref/request-response/#streaminghttpresponse-objects)
    - [`FileResponse` 对象](/zh-hans/5.1/ref/request-response/#fileresponse-objects)
    - [`HttpResponseBase` 类](/zh-hans/5.1/ref/request-response/#httpresponsebase-class)
  - [`SchemaEditor`](/zh-hans/5.1/ref/schema-editor/)

    - [方法](/zh-hans/5.1/ref/schema-editor/#methods)
    - [属性](/zh-hans/5.1/ref/schema-editor/#attributes)
  - [配置](/zh-hans/5.1/ref/settings/)

    - [核心配置](/zh-hans/5.1/ref/settings/#core-settings)
    - [认证](/zh-hans/5.1/ref/settings/#auth)
    - [消息](/zh-hans/5.1/ref/settings/#messages)
    - [会话](/zh-hans/5.1/ref/settings/#sessions)
    - [站点](/zh-hans/5.1/ref/settings/#sites)
    - [静态文件](/zh-hans/5.1/ref/settings/#static-files)
    - [核心配置专题索引](/zh-hans/5.1/ref/settings/#core-settings-topical-index)
  - [信号](/zh-hans/5.1/ref/signals/)

    - [模型信号](/zh-hans/5.1/ref/signals/#module-django.db.models.signals)
    - [管理信号](/zh-hans/5.1/ref/signals/#management-signals)
    - [请求／响应信号](/zh-hans/5.1/ref/signals/#module-django.core.signals)
    - [测试信号](/zh-hans/5.1/ref/signals/#module-django.test.signals)
    - [数据库包装器](/zh-hans/5.1/ref/signals/#module-django.db.backends)
  - [模板](/zh-hans/5.1/ref/templates/)

    - [Django 模板语言](/zh-hans/5.1/ref/templates/language/)
    - [内置模板标签和过滤器](/zh-hans/5.1/ref/templates/builtins/)
    - [Django 模板语言：对于 Python 开发者](/zh-hans/5.1/ref/templates/api/)
  - [`TemplateResponse` 和 `SimpleTemplateResponse`](/zh-hans/5.1/ref/template-response/)

    - [`SimpleTemplateResponse` 对象](/zh-hans/5.1/ref/template-response/#simpletemplateresponse-objects)
    - [`TemplateResponse` 对象](/zh-hans/5.1/ref/template-response/#templateresponse-objects)
    - [渲染过程](/zh-hans/5.1/ref/template-response/#the-rendering-process)
    - [使用 `TemplateResponse` 和 `SimpleTemplateResponse`](/zh-hans/5.1/ref/template-response/#using-templateresponse-and-simpletemplateresponse)
  - [Unicode 数据](/zh-hans/5.1/ref/unicode/)

    - [创建数据库](/zh-hans/5.1/ref/unicode/#creating-the-database)
    - [一般字符串处理](/zh-hans/5.1/ref/unicode/#general-string-handling)
    - [模型](/zh-hans/5.1/ref/unicode/#models)
    - [模板](/zh-hans/5.1/ref/unicode/#templates)
    - [文件](/zh-hans/5.1/ref/unicode/#files)
    - [表单提交](/zh-hans/5.1/ref/unicode/#form-submission)
  - [`django.urls` 实用函数](/zh-hans/5.1/ref/urlresolvers/)

    - [reverse()](/zh-hans/5.1/ref/urlresolvers/#reverse)
    - [`reverse_lazy()`](/zh-hans/5.1/ref/urlresolvers/#reverse-lazy)
    - [`resolve()`](/zh-hans/5.1/ref/urlresolvers/#resolve)
    - [`get_script_prefix()`](/zh-hans/5.1/ref/urlresolvers/#get-script-prefix)
  - [URLconfs 中使用的 `django.urls` 函数](/zh-hans/5.1/ref/urls/)

    - [`path()`](/zh-hans/5.1/ref/urls/#path)
    - [`re_path()`](/zh-hans/5.1/ref/urls/#re-path)
    - [`include()`](/zh-hans/5.1/ref/urls/#include)
    - [`register_converter()`](/zh-hans/5.1/ref/urls/#register-converter)
  - [URLconfs 中使用的 `django.conf.urls` 函数](/zh-hans/5.1/ref/urls/#module-django.conf.urls)

    - [`static()`](/zh-hans/5.1/ref/urls/#static)
    - [`handler400`](/zh-hans/5.1/ref/urls/#handler400)
    - [`handler403`](/zh-hans/5.1/ref/urls/#handler403)
    - [`handler404`](/zh-hans/5.1/ref/urls/#handler404)
    - [`handler500`](/zh-hans/5.1/ref/urls/#handler500)
  - [Django 实用程序](/zh-hans/5.1/ref/utils/)

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

    - [编写验证器](/zh-hans/5.1/ref/validators/#writing-validators)
    - [如何运行验证器](/zh-hans/5.1/ref/validators/#how-validators-are-run)
    - [内置验证器](/zh-hans/5.1/ref/validators/#built-in-validators)
  - [内置视图](/zh-hans/5.1/ref/views/)

    - [为开发中的文件提供服务](/zh-hans/5.1/ref/views/#serving-files-in-development)
    - [错误视图](/zh-hans/5.1/ref/views/#error-views)
- [元文件和杂记](/zh-hans/5.1/misc/)

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

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

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

    - [对于发布者](/zh-hans/5.1/misc/distributions/#for-distributors)
- [术语](/zh-hans/5.1/glossary/)
- [发行说明](/zh-hans/5.1/releases/)

  - [最终版本](/zh-hans/5.1/releases/#final-releases)

    - [5.1 发行](/zh-hans/5.1/releases/#release)
    - [5.0 发行](/zh-hans/5.1/releases/#id1)
    - [4.2 发行](/zh-hans/5.1/releases/#id2)
    - [4.1 发行](/zh-hans/5.1/releases/#id3)
    - [4.0 发行](/zh-hans/5.1/releases/#id4)
    - [3.2 发行](/zh-hans/5.1/releases/#id5)
    - [3.1 发行](/zh-hans/5.1/releases/#id6)
    - [3.0 发行](/zh-hans/5.1/releases/#id7)
    - [2.2 发行](/zh-hans/5.1/releases/#id8)
    - [2.1 发行](/zh-hans/5.1/releases/#id9)
    - [2.0 发行](/zh-hans/5.1/releases/#id10)
    - [1.11 发行](/zh-hans/5.1/releases/#id11)
    - [1.10 发行](/zh-hans/5.1/releases/#id12)
    - [1.9 发行](/zh-hans/5.1/releases/#id13)
    - [1.8 发行](/zh-hans/5.1/releases/#id14)
    - [1.7 发行](/zh-hans/5.1/releases/#id15)
    - [1.6 发行](/zh-hans/5.1/releases/#id16)
    - [1.5 发行](/zh-hans/5.1/releases/#id17)
    - [1.4 发行](/zh-hans/5.1/releases/#id18)
    - [1.3 发行](/zh-hans/5.1/releases/#id19)
    - [1.2 发行](/zh-hans/5.1/releases/#id20)
    - [1.1 发行](/zh-hans/5.1/releases/#id21)
    - [1.0 发行](/zh-hans/5.1/releases/#id22)
    - [1.0 前发行](/zh-hans/5.1/releases/#pre-1-0-releases)
  - [安全发行](/zh-hans/5.1/releases/#security-releases)
- [Django内部](/zh-hans/5.1/internals/)

  - [为 Django 做贡献](/zh-hans/5.1/internals/contributing/)

    - [通信渠道](/zh-hans/5.1/internals/contributing/#communication-channels)
    - [开始](/zh-hans/5.1/internals/contributing/#getting-started)
    - [Django 框架的工作](/zh-hans/5.1/internals/contributing/#work-on-the-django-framework)
    - [其他贡献方式](/zh-hans/5.1/internals/contributing/#other-ways-of-contributing)
  - [邮件列表和论坛](/zh-hans/5.1/internals/mailing-lists/)

    - [Django 论坛](/zh-hans/5.1/internals/mailing-lists/#django-forum)
    - [`django-announce`](/zh-hans/5.1/internals/mailing-lists/#django-announce)
    - [`django-updates`](/zh-hans/5.1/internals/mailing-lists/#django-updates)
    - [Archived mailing lists](/zh-hans/5.1/internals/mailing-lists/#archived-mailing-lists)
  - [Django 项目的组织](/zh-hans/5.1/internals/organization/)

    - [原则](/zh-hans/5.1/internals/organization/#principles)
    - [合并者](/zh-hans/5.1/internals/organization/#mergers)
    - [发布者](/zh-hans/5.1/internals/organization/#releasers)
    - [管理委员会](/zh-hans/5.1/internals/organization/#steering-council)
    - [改变组织](/zh-hans/5.1/internals/organization/#changing-the-organization)
  - [Django 的安全策略](/zh-hans/5.1/internals/security/)

    - [报告安全问题](/zh-hans/5.1/internals/security/#reporting-security-issues)
    - [Django 如何评估报告](/zh-hans/5.1/internals/security/#how-does-django-evaluate-a-report)
    - [支持的版本](/zh-hans/5.1/internals/security/#supported-versions)
    - [Security issue severity levels](/zh-hans/5.1/internals/security/#security-issue-severity-levels)
    - [Django 如何披露安全问题](/zh-hans/5.1/internals/security/#how-django-discloses-security-issues)
    - [谁会收到提前通知](/zh-hans/5.1/internals/security/#who-receives-advance-notification)
    - [请求通知](/zh-hans/5.1/internals/security/#requesting-notifications)
  - [Django 的发行流程](/zh-hans/5.1/internals/release-process/)

    - [正式发行](/zh-hans/5.1/internals/release-process/#official-releases)
    - [发行节奏](/zh-hans/5.1/internals/release-process/#release-cadence)
    - [废弃政策](/zh-hans/5.1/internals/release-process/#deprecation-policy)
    - [支持的版本](/zh-hans/5.1/internals/release-process/#supported-versions)
    - [发行过程](/zh-hans/5.1/internals/release-process/#release-process)
  - [Django废弃时间表](/zh-hans/5.1/internals/deprecation/)

    - [6.0](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-6-0)
    - [5.1](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-5-1)
    - [5.0](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-5-0)
    - [4.1](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-4-1)
    - [4.0](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-4-0)
    - [3.1](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-3-1)
    - [3.0](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-3-0)
    - [2.1](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-2-1)
    - [2.0](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-2-0)
    - [1.10](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-10)
    - [1.9](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-9)
    - [1.8](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-8)
    - [1.7](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-7)
    - [1.6](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-6)
    - [1.5](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-5)
    - [1.4](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-4)
    - [1.3](/zh-hans/5.1/internals/deprecation/#deprecation-removed-in-1-3)
  - [Django源代码库](/zh-hans/5.1/internals/git/)

    - [高级概述](/zh-hans/5.1/internals/git/#high-level-overview)
    - [主要分支](/zh-hans/5.1/internals/git/#the-main-branch)
    - [稳定分支](/zh-hans/5.1/internals/git/#stable-branches)
    - [标签(Tags)](/zh-hans/5.1/internals/git/#id1)
  - [Django 是如何形成的？](/zh-hans/5.1/internals/howto-release-django/)

    - [概况](/zh-hans/5.1/internals/howto-release-django/#overview)
    - [先决条件](/zh-hans/5.1/internals/howto-release-django/#prerequisites)
    - [发布前的任务](/zh-hans/5.1/internals/howto-release-django/#pre-release-tasks)
    - [实际发布版本](/zh-hans/5.1/internals/howto-release-django/#actually-rolling-the-release)
    - [将发布版本提供给公众](/zh-hans/5.1/internals/howto-release-django/#making-the-release-s-available-to-the-public)
    - [发布后](/zh-hans/5.1/internals/howto-release-django/#post-release)
    - [新稳定分支任务](/zh-hans/5.1/internals/howto-release-django/#new-stable-branch-tasks)
    - [关于设置 VERSION 元组的注意事项](/zh-hans/5.1/internals/howto-release-django/#notes-on-setting-the-version-tuple)

## 索引和词汇表

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