尝试创建表时,无法在Django中syncdb

时间:2014-12-25 11:45:43

标签: python django syncdb

这是在我尝试使用模型创建表时显示的。我尝试过几件事,但没有工作。

命令行

(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"

Settings.py

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'),
    }
}

1 个答案:

答案 0 :(得分:0)

先跑

python manage.py makemigrations joins

然后

python manage.py migrate