# 安装Django测试驱动开发环境

## 说明

准备DJango开发环境，同时准备测试驱动的方法:

* 使用Python 3
* Django
* Mac开发平台

## 安装Python 3

> Mac默认安装的Python 2.7，从[Python官网](https://www.python.org)下载安装最新3.x版本

Python 3.4之后版本包含了pip3，能够非常方便地管理模块安装，推荐使用。请使用官方提供最新的3.x版本。

## 安装Django

```
sudo pip3 install django
```

> 当前采用 1.10.5，安装以后使用可执行文件 `django-admin.py`

## 安装Selenium

Selenium是浏览器自动化工具，用来驱动功能测试。

```
sudo pip3 install --upgrade selenium
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/develop/python/django/prepare_django_env_with_tdd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
