Mac 安装Django

首先 我电脑上的python  是

安装Django  是需要通过 pip  来安装的  最新办的python3.4 应该内置了pip  因此这里 需要下载安装pip 

pip是常用的Python包管理工具

 

图未截全 。。。

pip  install  django

最后成这样了

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  InsecurePlatformWarning

因为SSL的问题,urllib3需要pyopenssl。
最简单的方法是:
sudo pip install pyopenssl ndg-httpsclient pyasn1

然后再次安装diango  

pip install -i http://pypi.douban.com/simple/  --trusted-host pypi.douban.com Django   

 这个是安装mysql时遇到的错误  需要下载一个 mysql-python 的 依赖。 当然如果你自己可以FQ 那就用不到。

pip install -i http://pypi.douban.com/simple/  --trusted-host pypi.douban.com MySQL-python

原文地址:https://www.cnblogs.com/yhl664123701/p/5999934.html