- 博客(4)
- 收藏
- 关注
原创 MySQLdb._exceptions.ProgrammingError: (1146, "Table 'django_db.index_type' doesn't exist")
Django的内置模型User扩展,增加了几个字段,然后干掉了数据库,并删除了每个app下的migrations文件夹内除了__init__.py的所有文件。 然后执行:python manage.py makemigrations就报错: 意思是找不到django_db.index_type这个表。 很明显,数据迁移就是为了创建数据库表,出现这个表明数据迁移之前程序已经在运行了,所以找不到表。...
2020-02-17 16:52:58
2781
原创 数据模型生成数据库表报错:No migrations to apply
Django 框架创建python web项目,因为数据模型models.py中类的字段发生变化,故而删除数据库中所有的表,同时删除migrations目录下除过__init__.py外的所有文件,最后执行命令: python manage.py makemigrations 目录migrations下生成了0001_initial.py文件 再执行:python manage.py migrat...
2020-02-12 14:49:18
306
原创 ERROR 1366 (HY000): Incorrect string value: '\xC8\xD9\xD2\xAB' for column 'name' at row 1
给Mysql数据库插入一条数据的时候,报这个错误: 解决思路:是因为数据库编码的问题 解决办法: 一、查看表index_product的编码格式: show create table index_product; 可以看到表的编码显示latin1 二、表的编码改成utf8: alter table index_product default character set utf8; 再次查看表的...
2020-02-11 18:57:03
488
原创 django.core.exceptions.ImproperlyConfigured: WSGI application 'MyDjango.wsgi.application' could not
使用Pycharm运行python项目报错: django.core.exceptions.ImproperlyConfigured: WSGI application ‘MyDjango.wsgi.application’ could not be loaded; Error importing module. 如图: 这种原因是项目本身某个文件的代码出错造成的,可以往前看会看到提示: 是因...
2020-02-10 18:26:05
13768
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅