?: (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/2.1/ref/databases/#mysql-sql-mode

增加黄色配件的配置:

DATABASES = {
'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.mysql',
'NAME': 'erebus',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
}

}
}



参考:https://www.jianshu.com/p/bc41a8bf9d9b

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-06-01
  • 2021-08-29
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2021-10-26
  • 2021-06-15
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案