odieatla odieatla - 3 months ago 7
Python Question

"python manage.py syncdb" not creating tables

I first ran

python manage.py syncdb


and it created the database and tables for me, then I tried to add more apps, and here's what I did:

create apps by

python manage.py startapp newapp


Then I added
'newapp'
to
INSTALLED_APPS
in setting.py:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'newapp',
)


At last I ran
syncdb
:

python manage.py syncdb


and here's the result I get:

Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)


I checked my db and there is no table named
newapp
, no table's name including
newapp
.

Answer

If you run:

python manage.py inspectdb > somefile.txt

You can get quickly check out if your database structure is matching your django models.