Re: Add warning or prohibit module level queries?

2016-02-25 Thread Curtis Maloney
+1 At the very least we need to provide better feedback or errors to help isolate _where_ this is happening. I've helped quite a number of people on IRC with this problem... firstly, people aren't understanding _what_ the problem is, but also discerning where it's happening is often quite

Re: Add warning or prohibit module level queries?

2016-02-25 Thread Aymeric Augustin
Hello, To the best of my knowledge, in Django 1.10, the window for such problematic database queries will shrink to the interval between the moment `apps.models_ready` becomes `True` and the moment `apps.ready` becomes `True`. That’s when AppConfig.ready() methods execute. In Django 1.9, if a

Add warning or prohibit module level queries?

2016-02-25 Thread Tim Graham
Simon proposed [0]: "I wonder if we should prevent django.db from executing queries until django.apps.apps.ready or at least issue a RuntimeWarning. We would have to go through deprecation but I'm pretty sure this would uncover a lot of existing application bugs and prevent future ones. This