manage.py runserver卡住(没有错误)

时间:2018-05-02 16:54:58

标签: django python-3.x

当我添加到__init__.pydefault_app_config = 'component.nodes.apps.NodesConfig'个应用文件时,会有下一个代码:

from django.apps import AppConfig


class NodesConfig(AppConfig):
    name = 'component.nodes'

    def ready(self):
        from component.nodes import signals

Django manage.py runserver卡住了,如果按ctrl-c我收到nex traceback时不发送任何错误:

^CTraceback (most recent call last):


File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/storj/storj/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/storj/storj/lib/python3.6/site-packages/django/core/management/__init__.py", line 318, in execute
    autoreload.check_errors(django.setup)()
  File "/home/storj/storj/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/home/storj/storj/lib/python3.6/site-packages/django/__init__.py", line
27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/storj/storj/lib/python3.6/site-packages/django/apps/registry.py", line 116, in populate
    app_config.ready()
  File "/home/storj/storjboard_server/component/nodes/apps.py", line 8, in ready
    from component.nodes import signals
  File "/home/storj/storjboard_server/component/nodes/signals.py", line 5, in <module>
    from component.nodes.tasks import node_info_update
  File "/home/storj/storjboard_server/component/nodes/tasks.py", line 5, in <module>
    from server.celery import app
  File "/home/storj/storjboard_server/server/celery.py", line 10, in <module>
    django.setup()
  File "/home/storj/storj/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/storj/storj/lib/python3.6/site-packages/django/apps/registry.py", line 71, in populate
    with self._lock:
KeyboardInterrupt

1 个答案:

答案 0 :(得分:0)

我发现问题是在signals.py中我使用芹菜异步任务,芹菜没有正确设置