The Error "Models aren't loaded yet" keeps bugging me!

Django needs to load all of the apps before you can work with them. So adding code which queries the database below your model definitions throws this error. For more details, check out https://docs.djangoproject.com/en/2.2/ref/applications/#how-applications-are-loaded

Thankfully, the fix is to move the non-model code into a ready() method so that the code is ran immediately after Django has loaded everything into memory and your database is ready. Check out https://docs.djangoproject.com/en/2.2/ref/applications/#django.apps.AppConfig.ready for more details.

Good luck!