一、运行
前端依赖拉取:
npm install
前端服务启动:npm run dev
后端依赖修改:
requirements.txt
先将mysqlclient 版本去掉下载,如果运行正常,就一切正常,如果运行报错缺少依赖,就一个一个下吧。依赖解决完了,然后,迁移数据
drf-yasg==1.21.7
mysqlclient
pypinyin==0.51.0
Swagger:
前提:放开swagger 权限,修改backend - application - urls.py -> line:53
permission_classes=(permissions.AllowAny),
二、开发
新增加模块:
produc
创建 app
python manage.py startapp product
【 注意自己新建 urls.py】
创建迁移文件
python manage.py makemigrations product
执行迁移(同步数据库)
python manage.py migrate
然后在 application - settings.py - INSTALLED_APPS 增加 product 模块