windows环境下Django安装配置

--python下载

https://www.python.org/downloads/

--pip 下载

https://pypi.python.org/pypi/pip

--pip 安装及路径

解压 pip-8.1.2

安装 python setup.py install

--pip配置

用户主目录下创建 D:\Users\xu_jz\pip

pip/pip.ini
[global]
index-url = http://pypi.douban.com/simple

pip install wheel --trusted-host pypi.douban.com
pip install certifi --trusted-host pypi.douban.com
pip install crab --trusted-host pypi.douban.com
pip install influxdb --trusted-host pypi.douban.com
pip install MySQL-python  --trusted-host pypi.douban.com
pip install numpy --trusted-host pypi.douban.com
pip install pandas --trusted-host pypi.douban.com
pip install pika --trusted-host pypi.douban.com
pip install pika-pool --trusted-host pypi.douban.com
pip install psutil --trusted-host pypi.douban.com
pip install psycopg2 --trusted-host pypi.douban.com
pip install pymssql --trusted-host pypi.douban.com
pip install pyodbc --trusted-host pypi.douban.com
pip install python-dateutil --trusted-host pypi.douban.com
pip install pytz --trusted-host pypi.douban.com
pip install pywin32 --trusted-host pypi.douban.com
pip install redis   --trusted-host pypi.douban.com
pip install requests --trusted-host pypi.douban.com
pip install setuptools  --trusted-host pypi.douban.com
pip install six --trusted-host pypi.douban.com
pip install thrift --trusted-host pypi.douban.com
pip install tornado --trusted-host pypi.douban.com

--添加pip环境变量
C:\Python27\Scripts

cd C:\Python27\Scripts

pip

--django安装

解压  Django-1.9.6

安装 python setup.py install

import django    --测试是否正确安装

--安装mysqldb库

下载 MySQL-python-1.2.3.win-amd64-py2.7.exe     http://www.codegood.com/archives/129

安装时报错 python version 2.7 required, which was not found in the registry

http://www.cnblogs.com/justdba/p/5600635.html    --生成python文件,并运行

--安装 requests库

requests-2.10.0-py2.py3-none-any.whl

cd 文件目录

pip install  requests-2.10.0-py2.py3-none-any.whl

--安装pymssql库

cd 文件目录

pymssql-2.1.1.win-amd64-py2.7.exe

--查看python package

pip list

--创建工程和项目

django-admin startproject mypro

cd mypro

django-admin startapp mysqltool

python manage.py runserver

--提示: You have unapplied migrations; your app may not work properly until they are applied.

python manage.py makemigrations
python manage.py migrate

python manage.py runserver

上一篇:C++:onnxruntime调用FasterRCNN模型


下一篇:浅谈BERT预训练源码