1

我已经使用通道创建了一个 django 应用程序,并使用 对其进行了测试python3 manage.py runserver,据我所知,它运行 Daphne 服务器作为命令的一部分。现在我只想按照文档运行一个独立的 Daphne 服务器和一些工作人员等来部署应用程序。问题是,我似乎daphne在终端中没有可用的命令。运行daphne my_project.asgi:channel_layer只会导致我的终端告诉我找不到 daphne 命令。(运行 Ubuntu 17.10,如果它完全相关)

当我使用 pip 安装频道包时,肯定安装了 Daphne。当我运行pip3 install daphne它时,它说我拥有所有相关的软件包并且安装是最新的。我在这里做傻事吗?似乎这仅适用于其他所有人。如何获得可用的 daphne 命令以便我可以使用它启动服务器?

4

1 回答 1

0

Got it. The fix was really easy; at first, I couldn't find the daphne install directory, but it was in ~/.local/bin. You can either run daphne from that directory, or add the directory to the system PATH so that bash can run it directly.

于 2018-02-04T13:39:58.767 回答