Django生成數據表時報錯mysql
1 WARNINGS: 2 ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default' 3 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
解決方法:sql
在settings.py裏數據庫位置添加:數據庫
1 'OPTIONS': { 2 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"3 {