GreaterWMS / GreaterWMS

This Inventory management system is the currently Ford Asia Pacific after-sales logistics warehousing supply chain process . After I leave Ford , I start this project . You can share your vacant warehouse space, use it for those in need, and generate income
https://www.56yhz.com/
Apache License 2.0
3.71k stars 948 forks source link

无法使用daphne起后端asgi #268

Closed such-stupid6 closed 1 year ago

such-stupid6 commented 1 year ago

可以用manage.py runserver 0.0.0.0:8008起后端,可以访问127.0.0.1:8008,用前端也能和数据库交互,但是用daphne起的话,访问127.0.0.1:8008没有任何response,请问是我的daphne版本不对还是其他什么原因呢?

Singosgu commented 1 year ago

daphne -p 8008 greaterwms.asgi:application

such-stupid6 commented 1 year ago

是这么用的没错,但是在本地用curl访问8008,没有任何的response,在停掉daphne之后才会显示Empty reply from server,在浏览器访问8008也看不到回包。我用docker的部署方式倒是能部署,但是我看docker的后端容器里好像也是用manage.py来run server的,有点不太懂是不是我的问题 image image

Singosgu commented 1 year ago

8008被占用

such-stupid6 commented 1 year ago

并没有 image docker我改了8000端口了

Singosgu commented 1 year ago

daphne -b 0.0.0.0 -p 8008 greaterwms.asgi:application

such-stupid6 commented 1 year ago

emmm还是不行 image image image image

Singosgu commented 1 year ago

curl 你的局域网ip,如果是服务器,就curl 公网ip

Singosgu commented 1 year ago

你8008换成8009啥的

such-stupid6 commented 1 year ago

依然不行,我尝试de了一下 image image 应该是进入了get_handler了 emm,我也再研究研究吧,学习学习

Singosgu commented 1 year ago

这个handler是个统计工具,你可以删除的,应该就好了

such-stupid6 commented 1 year ago

我给他注释掉了,现在还是连不上,甚至连print也不print了(:з」∠)

such-stupid6 commented 1 year ago

行,原来是 daphne -b 0.0.0.0 -p 8008 greaterwms.asgi:http_application 绷不住了

such-stupid6 commented 1 year ago

可以小改一下部署文档或者asgi.py了

Singosgu commented 1 year ago

可能是daphne库的改变,但是用http_application启动,我们也没有启动过,demo也不是这么弄得,就很奇怪