安装虚拟环境
windows
mkvirtualenv -p C:\Users\Administrator\AppData\Local\Programs\Python\Python38\Python.exe django_test
linux
mkvirtualenv -p python3 django_test
安装及运行
安装django
workon django_test
pip install Django -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install mysqlclient -i https://pypi.tuna.tsinghua.edu.cn/simple # Mysql依赖
生成项目框架
cd F:\www\python\djangotest
workon django_test
django-admin startproject HelloWorld
运行测试
- 启动项目
python manage.py runserver 0.0.0.0:8000
教程
常用命令
python manage.py startapp polls # 创建业务模块
python manage.py runserver 0.0.0.0:8000 # 启动项目
标签:Python,0.0,py,django,python,test
From: https://www.cnblogs.com/wangjinkui/p/16846735.html