2014-11-16 90 views
1

這裏是我的models.pyDjango的: '蟒蛇manage.py執行syncdb' 不會創建我的架構表

# coding: utf-8 
from django.db import models 

class P(models.Model): 
    n = models.CharField(max_length=255) 

class I(models.Model): 
    t = models.CharField(max_length=255) 
    p = models.ForeignKey(P) 

下面是命令行:

rm db.sqlite3 
$ python manage.py syncdb 
Operations to perform: 
    Apply all migrations: admin, contenttypes, auth, sessions 
Running migrations: 
    Applying contenttypes.0001_initial... OK 
    Applying auth.0001_initial... OK 
    Applying admin.0001_initial... OK 
    Applying sessions.0001_initial... OK 

You have installed Django's auth system, and don't have any superusers defined. 
Would you like to create one now? (yes/no): no 

它假裝它做的一切,但我看不出在數據庫表中,無論是我的代碼確實

回答

1

確保您的應用是在項目設置中INSTALLED_APPS列出的文件:

INSTALLED_APPS = (
    ..., 
    'your_app', 
) 
+0

@alecxe,謝謝你的更正。 – falsetru

+0

不客氣,你過去一年的進步是太棒了。真的很高興有你在這裏。 – alecxe

相關問題