Opened 16 years ago
Closed 15 years ago
#11308 closed (duplicate)
Django ignores an application if it's trying to import a module that doesn't exist
Reported by: | rynoinstereo | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello,
First off, I'm a brand new Django user so apologies if I don't make myself clear.
Just had a weird thing happen where I could not for the life of me, figure out why Django was saying all my Models were valid, yet when running manage.py validate and then syncdb, it would not create the tables for my newly created application.
The problem turned out to be that I was trying to include a model from one of my other applications ina the project but I had the name of the model wrong.
For some reason, this caused Django to completely ignore the model file for my newly created application, instead of reporting this as an error?
Change History (2)
comment:1 by , 16 years ago
Component: | Testing framework → Database layer (models, ORM) |
---|---|
milestone: | 1.1 |
Triage Stage: | Unreviewed → Accepted |
This is certainly annoying, but it isn't critical for v1.1 as it doesn't cause data loss.
The problem is that we are a bit enthusiastic eating ImportErrors during the loading process. There is a legitimate reason for catching ImportErrors; they are a byproduct of the the app loading process. However, errors such as this one should be raised to the user, rather than being eaten entirely.
Explicit reproduction instructions: Create a new application called 'testapp', and add it to settings.py. Put the following in testapp/models.py:
manage.py validate doesn't report errors; manage.py syncdb doesn't report any problems, but doesn't create the testapp_newmodel table, either.