这是在我尝试使用模型创建表时显示的。我尝试过几件事,但没有工作。
(test_env) C:\Users\User\Desktop\test_env\src>python manage.py syncdb
Operations to perform:
Apply all migrations: admin, contenttypes, joins, auth, sessions
Running migrations:
No migrations to apply.
from django.db import models
class Join(models.Model):
emai = models.EmailField()
timestamp = models.DateTimeField(auto_now_add = True, auto_now=False)
updated = models.DateTimeField(auto_now_add = False, auto_now=True)
def __unicode__(self):
return "Join"
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'joins',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
答案 0 :(得分:0)
先跑
python manage.py makemigrations joins
然后
python manage.py migrate