没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
二、项目创建后遇到的问题
1、生成迁移文件
python manage.py makemigrations
2、执行迁移文件
python manage.py migrate
3、查看虚拟环境
conda env list
4、更改虚拟环境
activate django
5、AttributeError: 'str' object has no attribute 'decode'
print("Response:", resp.text.encode('utf-8').decode('unicode_escape'))
中间加上 .encode('utf-8') 即可。
6、数据库连接时区问题
[mysqld]
default-time_zone = '+8:00'
7、TypeError: __init__() missing 1 required positional argument: 'on_delete'
定义外键的时候需要加上 on_delete=;
即:contract = models.ForeignKey(Contract, on_delete=models.CASCADE)
8、'Student' object is not iterable
学生不能迭代,,是因为在views中没有object.all 只查询没获取
9、django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2
1、生成迁移文件
python manage.py makemigrations
2、执行迁移文件
python manage.py migrate
3、查看虚拟环境
conda env list
4、更改虚拟环境
activate django
5、AttributeError: 'str' object has no attribute 'decode'
print("Response:", resp.text.encode('utf-8').decode('unicode_escape'))
中间加上 .encode('utf-8') 即可。
6、数据库连接时区问题
[mysqld]
default-time_zone = '+8:00'
7、TypeError: __init__() missing 1 required positional argument: 'on_delete'
定义外键的时候需要加上 on_delete=;
即:contract = models.ForeignKey(Contract, on_delete=models.CASCADE)
8、'Student' object is not iterable
学生不能迭代,,是因为在views中没有object.all 只查询没获取
9、django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2
资源评论
funny.996
- 粉丝: 2
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功