Running django channels with daphne on systemd

后端 未结 3 1301
Happy的楠姐
Happy的楠姐 2020-12-30 18:00

First of all, sorry for the long question, I hope a few of you have patience for this.

TL; DR: How do I load django settings correctly in systemd?

I am fol

3条回答
  •  感动是毒
    2020-12-30 18:19

    In your posted configs the daphne port seems to be off.

    you wrote:

    ws = new WebSocket("ws://localhost:8000/order/1/")
    ws.send("test")`
    

    while using 8001 in your systemd startup file

    ExecStart=/home/ubuntu/rest-api/env/bin/daphne --access-log /home/ubuntu/rest-api/access.log -b 0.0.0.0 -p 8001 farmaApp.asgi:channel_layer
    

提交回复
热议问题