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

解决方法: 用django的TestCase

from django.test import TestCase

 

or 

import django
django.setup()

 or

In [9]: from django.conf import settings

In [10]: settings.configure()

In [11]: import django

In [12]: django.setup()

 

posted on 2020-09-14 17:18  Go_Forward  阅读(550)  评论(0编辑  收藏  举报