1.指定django的版本,安装命令为
pip install django==1.11.4
2.安装django-widget-tweaks模块,安装命令为
pip install django-widget-tweaks模块
3.安装requirements.txt依赖
pip install -r requirements.txt
3.如果想在虚拟环境下运行,请安装virtualenv模块,安装命令为 pip install virtualenv
- 创建虚拟环境步骤
- 在文件夹下直接建立:
先新建文件夹python_ven_demo,
然后进入该文件夹cd python_ven_demo,
然后搭建虚拟环境:python -m venv . (注:venv 之后一个空格加上一点“.”)
- 在桌面上直接建立虚拟环境文件夹及虚拟环境:
直接输入 python -m venv python_ven_demo (虚拟环境文件夹名,直接在桌面建立了文件夹,同时生成了虚拟环境)
- 激活虚拟环境[注意:只有激活之后,才算进入该虚拟环境,否则安装包时,依然是安装在全局环境之下]
激活文件在Script文件夹下,激活:activate.bat,退出:deactivate.bat
激活方式为:dos 界面进入python_ven_demo/文件夹,然后输入activate.bat (也可直接输入activate)即可激活环境,输入python 就进入python3.6环境了 退出方式:输入deactivate.bat 或 deactivate
- 最后进入python虚拟环境,安装所需要的包,安装方式同windows安装方法一样,输入命令pip install 包名