django.core.exceptions.AppRegistryNotReady:在django,芹菜中没有加载应用程序的错误

时间:2018-06-05 11:11:53

标签: django django-models

我正在

  

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

django==2.0.2celery==4.1.0中的

错误。没有搜索帮助我。我试过了

import django
django.setup()

但似乎这对我不起作用。这是追溯:

[2018-06-05 10:41:42,529: ERROR/ForkPoolWorker-1] Task backend.ml.face_detection_request[891df311-fe6b-4456-8c30-84a0b9baf716] raised unexpected: AppRegistryNotReady("Apps aren't loaded yet.",)
Traceback (most recent call last):
  File "/home/user/lib/python3.5/site-packages/celery/app/trace.py", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/user/lib/python3.5/site-packages/celery/app/trace.py", line 629, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/user/wandresearchrepo/wandhub/wandhub/backend/ml.py", line 89, in face_detection_request
    from backend.models import Image
  File "/home/user/backend/models.py", line 6, in <module>
    class Company(models.Model):
  File "/home/user/lib/python3.5/site-packages/django/db/models/base.py", line 100, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/user/lib/python3.5/site-packages/django/apps/registry.py", line 244, in get_containing_app_config
    self.check_apps_ready()
  File "/home/user/lib/python3.5/site-packages/django/apps/registry.py", line 127, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

0 个答案:

没有答案