Questions tagged [daphne]

Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI, and developed to power Django Channels.

259 questions
1
vote
1 answer

WebSocket dosn't work with postman (django channels)

I have a Django project which I run locally on my mac. And I use channels to create websocket connection. And an interesting thing happened: The web socket works when I try to connect through .html file: myTemplate.html const ws = new WebSocket( …
Ihor Kram
  • 41
  • 5
1
vote
0 answers

how customize django graphql-jwt

how customize backend authenticate for graphql-jwt? If i user BaseBackend and return user i get exception " graphql.error.located_error.GraphQLLocatedError: 'NoneType' object has no attribute 'is_anonymous' " class MyBackend(BaseBackend): def…
Kirill
  • 43
  • 4
1
vote
0 answers

Django Channels Websocket hanging - WebSocketProtocol took too long to shut down and was killed

Environment: Ubuntu 16.04.6 conda 4.12.0 Apache/2.4.18 (Ubuntu) python==3.8.1 Django==4.0.3 channels==3.0.5 asgi-redis==1.4.3 asgiref==3.4.1 daphne==3.0.2 I am attempting to create a websocket service that only relays messages from redis to an…
1
vote
0 answers

daphne service listen failure: Couldn't listen on 0.0.0.0:8001 Address in already in use

as the title indicates I am using django-channels with daphne in the production server but when I show the status of daphne.service it says 8001 is already in use. The interesting thing is that the socket connection is working perfectly with the…
coder
  • 441
  • 1
  • 4
  • 19
1
vote
3 answers

Daphne ModuleNotFoundError: No module named 'app_name'

When I run daphne -b 0.0.0.0 -p 8000 --access-log=daphne.log config.asgi:application I get Daphne ModuleNotFoundError: No module named 'app_name' But when I run python3 manage.py runserver it works normally? When I remove app_1 from INSTALLED_APPS…
calen
  • 21
  • 1
  • 6
1
vote
1 answer

WebSocket connection to 'wss://...' failed: (Django + Gunicorn + Nginx + Daphne)

I'm getting an error while connecting the websocket. And I have read similar Q&A on stackoverflow but still not working for me. I've been trying all sorts of ways for days but still can't make the connection. This is my mistake The server I use is:…
N.Tuyen
  • 25
  • 2
  • 7
1
vote
1 answer

Connect via a secure websocket WSS from Django project to Redis/Daphne

I am trying to connect a secure websocket WSS with Redis/Daphne from my Django-Project: new WebSocket('wss://myproject.com:9002/ws/myChat/') But it is not possible to connect. In the Browser-Console I always get the following error: myCode.js:36…
Charbacca
  • 81
  • 1
  • 5
1
vote
0 answers

Websocket wss configurations in nginx, django, daphne

I have a Django server which uses websockets (Django channels). I have the following configurations of daphne and nginx. What the right way to configure ngnix for wss websockets? Here's what I have: /etc/nginx/sites-available/trading-backend server…
Kogelet
  • 395
  • 5
  • 14
1
vote
0 answers

channels slows app and creates many HTTP 500 errors

I use channels to inform the frontend of my app to force a page update. What I discovered is, that it is much slower in debug mode now and also I have tons of HTTP 500 in my webconsole. Occasionally I end up with: ERROR:daphne.server:Exception…
xtlc
  • 1,070
  • 1
  • 15
  • 41
1
vote
1 answer

Trouble with Django ASGI (DAPHNE) Deployment on HEROKU

i've been trying to deploy for the last couple days and I just can't seem to get it working: on heroku , it says application deployed but then when i go into the logs I see errors. I try opening up the app (for example, admin page) and I get…
Karan V
  • 163
  • 2
  • 10
1
vote
0 answers

Can you configure Supervisor + multiple Daphne processes w/ ssl endpoints

I'm trying to configure the following setup: Django w/ channels Multiple Daphne processes as the ASGI server, with ssl endpoints Supervisor managing Daphne No other server (nginx, etc.) in front of Daphne Without using ssl, I can bind all the…
tunecrew
  • 888
  • 9
  • 13
1
vote
1 answer

Enabling HTTP/2 Support in daphne with django

When I run this command command: daphne -e ssl:443:privateKey=key.pem:certKey=crt.pem server.asgi:application --port 8000 --bind 0.0.0.0 The error I get is as follows Starting server at…
Joseph Adam
  • 1,341
  • 3
  • 21
  • 47
1
vote
0 answers

WebSocket is already in CLOSING or CLOSED state- heroku django

I did a chatting part in my web app with django it works perfectly in local but after I deployed it to heroku , it doesn't work: this is my consumers.py class: from channels.generic.websocket import AsyncWebsocketConsumer from…
marc-stupid
  • 133
  • 1
  • 15
1
vote
1 answer

Traefik conf for server-side events

I'm trying to set a server-side event correctly with Traefik to no avail. I have a Django server that has a URL that sends sse, I can proxy easily with nginx with this simple conf: server { listen 80; server_name _ ; charset utf-8; …
Alessandro Dentella
  • 1,250
  • 2
  • 16
  • 30
1
vote
0 answers

Getting ERR_TIMED_OUT un Chromium when trying to run a pagekite daphne server on Linux

I want to run a Python backend for a website with pagekite and daphne. I use the following commands: daphne -b 0.0.0.0 -p 8000 main:app And: python3 pagekite.py 0.0.0.0:8000 https://something.pagekite.me Or: python3 pagekite.py 8000…
Petr L.
  • 414
  • 5
  • 13