Import Posts

1 post tagged with import

I was debugging an issue with our Django app at work today; an file wasn't being picked up, and nothing was appearing in the admin pages. It turned that an ImportError was being thrown in the and Django was interpreting this as the file not existing.

I'm assuming that the reason for this is that Django uses __import__ to import the module, and catches ImportError's if the doesn't exist. The trouble with this is that if does exist, and throws an ImportError of its own, Django will also interpret that as a missing – which can be misleading. continue reading…