Pyhon笔记
Exception捕获异常报 Too broad exception clause 警告
解决办法
- 关闭编译器中代码检测中有关检测 Exception 的选项
- 在 try 语句前加入 # noinspection PyBroadException
执行python项目报错,
ERRORS:
?: (translation.E004) You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.
解决方法
django3.0开始LANGUAGE_CODE前面必须配相应的LANGUAGES配置如下:
from django.utils.translation import gettext_lazy as _
运行vue项目报错e.apply is not a function
解决办法:
是我的变量名和函数名重名了,修改一下名字就行
django更新数据模型
python manage.py inspectdb > app/models.py (路径)
python manage.py makemigrations
python manage.py migrate