0
剛剛完成新建項目並創建超級用戶。當我編碼models.py並使用eclipse運行遷移時,它會拋出錯誤消息,並且我的Django管理員中沒有任何內容。運行Python時發生Mysql錯誤Django使用eclipse遷移
這是錯誤消息。
System check identified some issues:
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.10/ref/databases/#mysql-sql-mode
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
No migrations to apply.
Finished "C:\Users\ds\workspace\board\manage.py migrate" execution.
這是我的models.py
from __future__ import unicode_literals
from django.db import models
from unittest.util import _MAX_LENGTH
from pip.cmdoptions import editable
from django.template.defaultfilters import default
from datetime import datetime
# Create your models here.
class User(models.Model):
id = models.CharField(_MAX_LENGTH=10)
password = models.CharField(_MAX_LENGTH=10)
join_date = models.DateTimeField(editable=False, default=datetime.now())
class todo(models.Model):
user = models.ForeignKey('id')
title = models.TextField
content = models.TextField
date = models.DateField(editable=False, default=datetime.now())
酷的故事,兄弟。那裏有什麼問題嗎? https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ – spencer7593
你能否將settings.py中的數據庫部分添加到你的問題中? –