{"title":"FAQ：安装","version":"2.1","locale":"zh-hans","docname":"faq/install","url":"/zh-hans/2.1/faq/install/","canonical":"https://djangodocs.dev/zh-hans/2.1/faq/install/","summary":"如何开始？ Link to this heading # 下载代码 。 安装 Django （阅读 安装指南 ）。 查看 教程第 1 部分 。 阅读剩下的指南</index>，如果你遇到任何问题，提问是一个不错的解决方法。 使用Django，需要做好什么准备？ Link to this heading # Django…","html":"<h1>FAQ：安装<a class=\"heading-anchor\" href=\"#faq-installation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<section id=\"how-do-i-get-started\">\n<h2>如何开始？<a class=\"heading-anchor\" href=\"#how-do-i-get-started\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<ol class=\"arabic simple\">\n<li><p><a class=\"reference external\" href=\"https://www.djangoproject.com/download/\">下载代码</a> 。</p></li>\n<li><p>安装 Django （阅读 <a class=\"reference internal\" href=\"/zh-hans/2.1/intro/install/\"><span class=\"doc\">安装指南</span></a>）。</p></li>\n<li><p>查看 <span class=\"xref std std-doc\">教程第 1 部分</span> 。</p></li>\n<li><p>阅读剩下的指南&lt;/index&gt;，如果你遇到任何问题，提问是一个不错的解决方法。</p></li>\n</ol>\n</section>\n<section id=\"what-are-django-s-prerequisites\">\n<h2>使用Django，需要做好什么准备？<a class=\"heading-anchor\" href=\"#what-are-django-s-prerequisites\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django 要求先安装 Python。参见下个问题中的表格，它介绍了各个 Django 版本所支持的 Python 版本。某些情况下可能需要一些额外的 Python 库，如果未安装，你会在这些库被用到时获得一个错误提示。</p>\n<p>对于开发环境——如果你用 Django 进行实验——你不需要安装单独的Web服务器；Django 带有自己的轻量级开发服务器。对于生产环境， Django 遵循了 WSGI 规范：pep: 3333， 这意味着它能够运行在各种服务器平台上。请参阅文档 Django 部署&lt;/howto/deployment/index&gt; 获取更多的流行方案。</p>\n<p>有时候，你可能会想在 Django 上使用数据库，那么你需要一个数据库引擎。我们推荐使用 <a class=\"reference external\" href=\"https://www.postgresql.org/\">PostgreSQL</a> ，因为我们是 PostgreSQL 的忠实粉丝，但是 Django <a class=\"reference external\" href=\"https://www.mysql.com/\">也同样支持MySQL</a> ，<a class=\"reference external\" href=\"https://www.sqlite.org/\">SQLite3</a> 和 <a class=\"reference external\" href=\"https://www.oracle.com/\">Oracle</a> 。</p>\n</section>\n<section id=\"what-python-version-can-i-use-with-django\">\n<span id=\"faq-python-version-support\"></span><h2>我应该使用哪个版本的 Python 来配合 Django?<a class=\"heading-anchor\" href=\"#what-python-version-can-i-use-with-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<div class=\"table-scroll\" role=\"region\" tabindex=\"0\" aria-label=\"Table\"><table class=\"docutils align-default\">\n<thead>\n<tr class=\"row-odd\"><th class=\"head\"><p>Django 版本</p></th>\n<th class=\"head\"><p>Python 版本</p></th>\n</tr>\n</thead>\n<tbody>\n<tr class=\"row-even\"><td><p>1.11</p></td>\n<td><p>2.7, 3.4, 3.5, 3.6, 3.7 (1.11.17添加)</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>2.0</p></td>\n<td><p>3.4，3.5，3.6，3.7</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>2.1，2.2</p></td>\n<td><p>3.5，3.6，3.7</p></td>\n</tr>\n</tbody>\n</table>\n</div>\n<p>对于每个版本的Python，官方仅支持最新的三级版本（A.B.C）。你可以在`Python下载页面 &lt;<a class=\"reference external\" href=\"https://www.python.org/downloads/\">https://www.python.org/downloads/</a>&gt;`_ 找到每个系列的微版本。</p>\n<p>一般来说，我们会支持一个 Python 版本直到其第一个发布的 Django LTS 安全支持停止。而 Django LTS 版本安全支持停止是跟随这其对应版本的 Python 安全支持结束的。例如，Python 3.3 安全支持在2017年9月结束，然后 Django 1.8 LTS 安全支持在2018年4月结束。因此 Django 1.8 是支持 Python 3.3 的最后一版。</p>\n</section>\n<section id=\"what-python-version-should-i-use-with-django\">\n<h2>我应该选用什么版本的 Python 来使用 Django ？<a class=\"heading-anchor\" href=\"#what-python-version-should-i-use-with-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>我们推荐 Python 3。Django 1.11 是支持 Python 2.7 的最后一版。Python 2.7 和 Django 1.11 的支持将会在2020年结束。</p>\n<p>因为新版本的 Python 通常会更快，拥有更多特性，而且有更好的支持，推荐使用 Python 3 的最新版本。</p>\n<p>使用旧版本的 Django 你不会丢失任何东西，但是你不能得到新版本 Python 的改进和优化。当然，Django 的第三方插件可以自由设置他们的版本要求。</p>\n</section>\n<section id=\"should-i-use-the-stable-version-or-development-version\">\n<h2>我应该使用稳定版本还是开发版本？<a class=\"heading-anchor\" href=\"#should-i-use-the-stable-version-or-development-version\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>一般来说，如果你在生产中使用Django，你应该使用稳定版本。Django每9个月发布一次稳定版本，之后会间断发布修复补丁的版本。这些稳定版本包含的API都是先后兼容的；如果你是按照稳定版本来进行编写代码，那你在下一个正式版本升级的时候不应该出现问题。</p>\n</section>","rootId":"faq-installation","toc":[{"title":"如何开始？","anchor":"how-do-i-get-started","children":[]},{"title":"使用Django，需要做好什么准备？","anchor":"what-are-django-s-prerequisites","children":[]},{"title":"我应该使用哪个版本的 Python 来配合 Django?","anchor":"what-python-version-can-i-use-with-django","children":[]},{"title":"我应该选用什么版本的 Python 来使用 Django ？","anchor":"what-python-version-should-i-use-with-django","children":[]},{"title":"我应该使用稳定版本还是开发版本？","anchor":"should-i-use-the-stable-version-or-development-version","children":[]}],"breadcrumbs":[{"docname":"faq/index","title":"Django FAQ","url":"/zh-hans/2.1/faq/"}],"prev":{"docname":"faq/general","title":"FAQ: 概述","url":"/zh-hans/2.1/faq/general/"},"next":{"docname":"faq/usage","title":"FAQ: 使用Django","url":"/zh-hans/2.1/faq/usage/"},"formats":{"html":"/zh-hans/2.1/faq/install/","markdown":"/zh-hans/2.1/faq/install.md","json":"/zh-hans/2.1/faq/install.json"},"source":"https://github.com/django/django/blob/stable/2.1.x/docs/faq/install.txt","official":"https://docs.djangoproject.com/zh-hans/2.1/faq/install/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}