This also caused some heartache for me. I opened a ticket with a simple patch here: http://code.djangoproject.com/ticket/13043. I'm sure something more elaborate could be done, but simply printing the ImportError in the console has been all I've needed thus far. Perhaps you could update this ticket with your solution?
Sam Dolan On May 16, 3:10 pm, cool-RR <ram.rac...@gmail.com> wrote: > Hello all. > > This is my first time on Django-developers. > > I remember that a few months ago, when I was doing some Django work, > there was something that annoyed me. I hope I'm remembering this > correctly, please correct me if I'm wrong. It happened sometimes that > the settings module in my project/app will cause an ImportError inside > itself. This will be caught by the `except` in the block that tries to > import the settings module, and this will cause it to raise another > ImportError saying that the settings module wasn't found or caused an > ImportError. This would make it difficult to understand how exactly > the settings module was causing the ImportError. > > Is this precise? Does this still happen? > > Because I have just implemented something that solves this annoyance > for my own project, (which is unrelated to Django but also has a need > to import a settings module, similarly to Django.) In my solution, if > the settings module doesn't exist, I can get an ImportError (if I > wish, I can also make it fail silently), but if there's an ImportError > inside, I will have that error raised as itself, and not caught by my > logic, making it easier to debug. > > I'm basically just trying `imp.find_module` before I import. > > Would you have any interest in me patching Django to use this logic? > > Ram Rachum. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-developers?hl=en. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.