Django生成数据表时报错

Django生成数据表时报错-LMLPHP

 WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode

解决方法:

在settings.py里数据库位置添加:

Django生成数据表时报错-LMLPHP

 'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
3 {
05-11 22:12
查看更多