Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 1.9:Django.core.exceptions.AppRegistryNotReady:应用程序不';还没装呢_Django_Python 2.7 - Fatal编程技术网

Django 1.9:Django.core.exceptions.AppRegistryNotReady:应用程序不';还没装呢

Django 1.9:Django.core.exceptions.AppRegistryNotReady:应用程序不';还没装呢,django,python-2.7,Django,Python 2.7,我正在尝试在我的应用程序中使用此应用程序。我的Django版本是1.9。我得到以下错误: python manage.py runserver Unhandled exception in thread started by <function wrapper at 0x7f4931ce85f0> Traceback (most recent call last): File "/home/bewithaman/Projects/ems/local/lib/python2.7/s

我正在尝试在我的应用程序中使用此应用程序。我的Django版本是1.9。我得到以下错误:

python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x7f4931ce85f0>
Traceback (most recent call last):
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/bewithaman/Projects/Event-Management-System/chance/__init__.py", line 1, in <module>
    from chance import signals
  File "/home/bewithaman/Projects/Event-Management-System/chance/signals.py", line 7, in <module>
    from chance.models import Registration
  File "/home/bewithaman/Projects/Event-Management-System/chance/models.py", line 2, in <module>
    from django.contrib.auth.models import User
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 49, in <module>
    class AbstractBaseUser(models.Model):
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/registry.py", line 239, in get_containing_app_config
    self.check_apps_ready()
  File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
我已经按照所有的指示去做了,但我不知道出了什么问题。请帮助我。

您正在使用的应用程序已经好几年没有更新了,并且似乎不支持Django 1.9。您可以使用不同的应用程序,也可以尝试将其更新以使用Django 1.9

回溯的这一部分显示它在
\uuuu init\uuuu.py
中导入
signals.py
,它尝试在加载应用程序之前导入模型

  File "/home/bewithaman/Projects/Event-Management-System/chance/__init__.py", line 1, in <module>
    from chance import signals
  File "/home/bewithaman/Projects/Event-Management-System/chance/signals.py", line 7, in <module>
    from chance.models import Registration
然后创建一个
change/apps.py
文件,并定义一个app config类,该类在
ready()
方法中导入信号

from django.apps import AppConfig

class ChanceConfig(AppConfig):

    def ready(self):
        from . import signals
最后,更新
已安装的应用程序设置以使用配置

INSTALLED_APPS = [
    ...
    'chance.apps.ChanceConfig',
    ...
]
您正在使用的应用程序已经好几年没有更新了,并且似乎不支持Django 1.9。您可以使用不同的应用程序,也可以尝试将其更新以使用Django 1.9

回溯的这一部分显示它在
\uuuu init\uuuu.py
中导入
signals.py
,它尝试在加载应用程序之前导入模型

  File "/home/bewithaman/Projects/Event-Management-System/chance/__init__.py", line 1, in <module>
    from chance import signals
  File "/home/bewithaman/Projects/Event-Management-System/chance/signals.py", line 7, in <module>
    from chance.models import Registration
然后创建一个
change/apps.py
文件,并定义一个app config类,该类在
ready()
方法中导入信号

from django.apps import AppConfig

class ChanceConfig(AppConfig):

    def ready(self):
        from . import signals
最后,更新
已安装的应用程序设置以使用配置

INSTALLED_APPS = [
    ...
    'chance.apps.ChanceConfig',
    ...
]