环境: centos 6.5 ; python2.76(编译安装)
1、从官网下载 django 源码包,https://www.djangoproject.com/
2、解压,编译安装 django
tar –xf Django-1.7.7.tar.gz
cd Django-1.7.7
python setup.py install //这里会报错
## 报错:“ImportError No module named setuptools” ,需安装 setuptools模块;如下
# wget "https://bitbucket.org/pypa/setuptools/get/default.tar.gz#egg=setuptools-dev" --no-check-certificate
# tar -xzvf default.tar.gz
# cd pypa-setuptools-da9a12631950/
# python setup.py install
3、djongo 安装成功后,python 命令行导入 django
>>> import django
4、建立 django-admin.py 的软链接,否则 会找不到命令
ln -s /usr/local/python2.76/bin/django-admin.py /usr/bin/django-admin.py