Django is not creating all the tables

882 views
Skip to first unread message

Thales

unread,
Aug 6, 2010, 10:55:33 AM8/6/10
to Django users
Hi everybody,

I am working in a project using django, which has about 20 apps's.
There is no tests written and It was decided that tests would have to
be written for the whole project.

To start testing, I runned:
"python manage.py test"

And a database was created, tables and stuff... But one table wasnt
created, so I got this error:
"Error: Database test_febrace couldn't be flushed. Possible reasons:
* The database isn't running or isn't configured correctly.
* At least one of the expected database tables doesn't exist.
* The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlflush'. That's the
SQL this command wasn't able to run.
The full error: (1146, "Table 'test_febrace.submissao_projeto'
doesn't exist")"

Trying to discover what the problem was, I deleted all my tables and
runned:
"python manage.py syncdb"
And... 2 of the tables weren't created in my mysql database. Both of
them are from the same app, which has other models and the other
models tables were succesfully created.

I tryed
"python manage.py sqlall *appname*" and I executed the returned sql
statements in my mysql server, so the tables were created.

Any suggestion? For the project, it is ok to create manually executing
the sqlall commands for me, but this way I cant test.

Thank you!

Thales

unread,
Aug 6, 2010, 12:15:53 PM8/6/10
to Django users
It seems to be a django bug. I changed the apps order in INSTALED_APPS
in settings.py and everything started to work correctly.

Boguslaw Faja

unread,
Aug 6, 2010, 3:05:16 PM8/6/10
to django...@googlegroups.com
Hi,

maybe there are some dependencies between this reordered apps? Could
you describe a bit more them?

best regards,

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
Bogusław Faja
tel. (+48) 691544955

Reply all
Reply to author
Forward
0 new messages