What is this warning for AppConfig.ready() about?

In light of the warnings against queries using the ORM before the apps are ready, we decided to go the route of doing it all in the settings as well. While it does result in settings code that is more brittle than desired, it has the upside that any broken code is made painfully obvious to the developer as the server won’t even get to the point of throwing hundreds of failed tests due to missing database connections.

The process is now this:

  1. Set default values for non-essential settings
  2. Load custom values for settings, which in turn:
    1. Check if the executed command is the test command.
    2. Set the default database to either a SQLite test database or a regular database depending on the step above
    3. Set custom values for various settings. A template is provided which corresponds to a dev environment, that does not allow outside access
  3. Check if all essential settings have been provided by the custom settings
  4. Load project database connections by either:
    1. If it is a test command: Crawling through fixtures to check which projects are required and add SQLite database connections for all found
    2. If not: Check the default database for connection details to the project databases and add them

This process should have the desired behaviour for all four combinations of dev/prod environments and test/live command. I don’t see how it could happen that production data ends up in tests.