Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"python manage.py syncdb" not creating tables

Tags:

python

django

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.

like image 520
odieatla Avatar asked Apr 23 '14 05:04

odieatla


1 Answers

I also ran into this issue, and was able to get around it by removing the migrations folder inside my app. Somehow that had already gotten created and was tricking syncdb into thinking that it was fully migrated already, but those migration scripts didn't actually do anything useful. Obviously don't try this if you actually have migrations you want to save, but I was working with a brand new app and models.

like image 72
Ancharon Avatar answered Oct 19 '22 21:10

Ancharon