Ticket #29 (closed defect: fixed)
show import errors rather than saying "doesn't exist"
| Reported by: | anonymous | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | commands | Version: | 0.6-pre |
| Keywords: | Cc: |
Description
I had a typo in one of my models (model vs models) so south couldn't import it -- but rather than saying so, it kept insisting it didn't exist.
Attachments
Change History
comment:2 Changed 5 years ago by anonymous
Why not just display the import error?
I think the gain in seeing problems with the migration trumps the loss in clarity from the 'no module named blahbity.blah' vs a filename. At a minimum, the error would be clearer if it said 'unable to import'.
Just because Django does it wrong doesn't mean one has to follow suit! I mean that tongue in cheek, but seriously, it's a source of frustration in Django, too - it's not like one can ignore the error, but it does make tracking them down more difficult.
comment:3 Changed 5 years ago by andrew
- Status changed from closed to reopened
- Resolution wontfix deleted
You have a good point, and I'll try not to reply in a stupid way to tickets next time. I've checked in [78] - it prints a "we think it's missing" error message, and also shows the traceback.

This is a difficult one - the only way we can detect if a migration doesn't exist is to try to import it and see if ImportError? is raised, and it's nigh-on impossible (bar some ugly string parsing) to tell the "migration not here" error from the "problem inside the migration" error.
The same problem is in Django settings.py files - import something spurious inside there and see Django claim your conf doesn't exist.
Marking as WONTFIX for now, until a sensible solution can be found (and Django hasn't found one yet...). I will, however, stick an FAQ up about it.