1

Strange error, think I must be missing something obvious. I've created a services.py file in my app which will populate my database when the file is run. So it isn't run every time the server boots/queries the file I've added:

if __name__ == '__main__':
    import ...
    from models import Authority, Rating

    <logic to populate database>

However, when I run the file, Django is throwing the exception:

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Am I running this file from the wrong place? Would it be better suited to my models file? If so, how do I stop it running every time the server boots?

Mike
  • 23
  • 1
  • 5

0 Answers0