---
title: "快速安装指南"
version: 2.1
locale: zh-hans
source: https://docs.djangoproject.com/zh-hans/2.1/intro/install/
canonical: https://djangodocs.dev/zh-hans/2.1/intro/install/
---
# 快速安装指南

开始用 Django 前，需要先进行安装。我们写了 [complete installation guide](/zh-hans/2.1/topics/install/) 罗列了各种安装方法；它会指导你完成最小，快速安装。

## 安装 Python

作为一个 Python Web 框架，Django 需要 Python。更多细节请参见 [我应该使用哪个版本的 Python 来配合 Django?](/zh-hans/2.1/faq/install/#faq-python-version-support)。Python 包含了一个名为 [SQLite](https://sqlite.org/) 的轻量级数据库，所以你暂时不必自行设置一个数据库。

最新版本的 Python 可以通过访问 <https://www.python.org/downloads/> 或者操作系统的包管理工具获取。

你可以在你的 shell 中输入 `python` 来确定你是否安装过 Python；你看到的可能是像这样子的:

```
Python 3.x.y
[GCC 4.x] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

## 设置数据库

此步骤仅在你打算使用诸如 PostgreSQL, MySQL, 或者 Oracle 这些大型数据库引擎时需要。要安装这种数据库, 请参考 [database installation information](/zh-hans/2.1/topics/install/#database-installation)。

## 安装 Django

你有三个简单的方法来安装 Django：

- [Install an official release](/zh-hans/2.1/topics/install/#installing-official-release) 适合大部分用户。
- 安装 Django [provided by your operating system distribution](/zh-hans/2.1/topics/install/#installing-distribution-package)。
- [Install the latest development version](/zh-hans/2.1/topics/install/#installing-development-version) 这个选择是针对那些想要体验最新和最好的特性的爱好者们，并不怕运行全新代码。你在开发版中可能会遇到新的 bug，可以报告给社区团队帮助 Django 开发。此外，第三方发行的软件包也可能不与开发版进行兼容。

> **请始终参考与你所使用的版本对应的 Django 文档！**
>
> 如果采用了前两种方式进行安装，你需要注意在文档中标明  **在开发版中新增**。这个标记表明这个特性仅适用开发版 Django，并且他们可能不会在官方发布的稳定版中出现。

## 验证

若要验证 Django 是否能被 Python 识别，可以在 shell 中输入 `python`。 然后在 Python 提示符下，尝试导入 Django：

```
>>> import django
>>> print(django.get_version())
2.1
```

当然了，你也可能安装的是其它版本的 Django。

## 搞定！

搞定，现在你可以 [move onto the tutorial](/zh-hans/2.1/intro/tutorial01/)。
