Django信号在多容器设置中不能与通道一起工作

我有Django的应用程序,并实施与渠道和渠道api的 websocket支持。 我正在使用解复用器绑定到我的模型。 例如,当我保存一个模型,它会发送更改到我打开的websocket连接。 一切工作正常,如果我运行./manage.py runserver 0:80 ,并在一个容器中。 但是,如果我分开我的应用程序UWSGI,达芙妮和使用docker的工人容器信号不会触发。 例如,我想任何芹菜工(任务)触发信号,并通过websocket发送更新。 在我的多容器设置websocket连接build立好了,networking工作正常,但没有触发信号。

信号是如何定义的,你可以在github上看到。

我使用Django的1.9.12,python2.7,docker和build立在debian拉伸。

泊坞窗,compose.yml

  web: build: . ports: ["8001:80"] daphne: build: . command: daphne -b 0.0.0.0 -p 8000 --access-log - -v 2 my_proj.asgi:channel_layer ws_worker: build: . command: ./manage.py runworker -v 2 celery_worker: build: . command: /usr/local/bin/celery -A my_proj worker 

nginx.conf

 upstream django { server unix:/home/docker/app.sock; } server { listen 80; server_name 127.0.0.1; charset utf-8; client_max_body_size 1000M; location /static/ { alias /home/docker/static/; } # proxy to other container location /ws/ { proxy_pass http://daphne:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location / { uwsgi_pass django; include /home/docker/uwsgi_params; } } 

我的问题是,信号不加载,因为我定义的绑定类其他比models.py。 如果我加载模型后加载在my_app / config.py它跨越多个容器

 from django.apps import AppConfig as DefaultAppConfig class AppConfig(DefaultAppConfig): def ready(self): # for websockets bindigns from my_app.websockets.bindings_one import * from my_app.websockets.bindings_two import *