Questions tagged [django-channels]
Should be used for the django-channels project that brings asynchrony (WebSockets and HTTP2) to django.
1,420
questions
0
votes
1
answer
23
views
Django channels unable to connect(find) websocket after docker-compose of project using redis
I have currently implemented websocket connections via django channels using a redis layer.
I'm new to docker and not sure where I might have made a mistake. After the docker-compose up -d --build the ...
0
votes
0
answers
15
views
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 ...
-2
votes
0
answers
18
views
Download Excel File in Django
we have several complicated, long-running functions that generate data reports. These services started taking longer as we scaled up, and we were getting concerned that our report generation functions ...
0
votes
1
answer
28
views
Django Channels: Send message from outside Consumer Class
I'm new in Python and Django,
Currently, I need to setup a WebSocket server using Channels.
I follow the code in this link: Send message using Django Channels from outside Consumer class
setting.py
...
0
votes
0
answers
23
views
WebSocket connection to 'url' failed
I just deployed a django project that uses djagno channels in heroku..
when I try to create a websocket connection form http://localhost:3000/ to the url, I am getting connection to websocket failed
...
0
votes
1
answer
27
views
django channels - possible for "write-only" channel group?
Hopefully this is gonna make sense. I am building an app using django-channels that works a little bit like a quiz - there is a host, and multiple players. When something goes wrong in the player side ...
-2
votes
0
answers
21
views
Django channels with redis [closed]
I am trying to do a chat app in Django with channels and Redis. But when I run it I see in the console this image. The one error in the console is this:
?username=fdg:94 Uncaught DOMException: Failed ...
0
votes
0
answers
27
views
Strange behavior with django and websocket behind nginx
I have a Docker Django app which uses django channels and Redis to stream data. All this is behind Nginx. Everything seems to work well. I can reach my sites under subdomains and i also can connect ...
0
votes
0
answers
30
views
asyncio.create_subprocess_shell => how write and read from diferent method asyncio django channels
I'm trying to implement a web telnet client with django & django-channels.
When a websocket request is comming the connect method creates a subprocess and a new "terminal" is started.
...
0
votes
0
answers
12
views
Django new WebSocket(url)
I am trying to do a chat app in django with channels. I try to do it from this video. But when I run it I get in console (index):16 WebSocket connection to 'ws://127.0.0.1//8000/ws/socket-server/' ...
1
vote
0
answers
24
views
Media Streaming Servers for Django [closed]
I and my team are starting a project where in we are building a scalable live streaming platform just like Youtube. We are using Django as the backend framework.
Which is the best media streaming ...
1
vote
0
answers
23
views
Error in authenticate a websocket with token authentication on django channels?
I face an error when calling the websocket url with passing a JWT token for authentication purpose:
my websocket request is:
ws://127.0.0.1:8000/chat/chat_2/?token=
the error is:
raise ValueError(&...
0
votes
0
answers
11
views
Django Channels Rest Framework V3 @model_observer message is None
I tried to find anything in the documentation of model observer which could explain under which conditions the model observer is called with message = None, but there was nothing particularly hinting ...
0
votes
0
answers
22
views
Django Channels self.scope['user'] shows blank output
I'm trying to get self.scope['users'] on consumers but the output is always blank, however when I try to get self.scope['users'].id it gives a proper output i.e id of the user.
I'm authenticating and ...
0
votes
1
answer
37
views
Is it posible to listen to an MQTT server and publish with Websocket (endpoint) from our own server
I have got an mqtt consumer that listens to a topic and based on that, I used to send a response on another topic.
However now I would like to create a Websocket Secure wss endpoint where i could ...
0
votes
0
answers
41
views
django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'snp.routing'
ASGI_APPLICATION = 'snp.routing.application'
routing.py:
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import chat.routing
application = ...
0
votes
1
answer
25
views
How to pass bearer token to raw websocket in Postman
I am trying to build a chat application with django channels, however, can't figure a way to pass bearer token
I am trying to reach the following url: ws://localhost:8000/ws/chat/1/
I am familiar with ...
0
votes
1
answer
25
views
DJango channels subscribe to multiple events
I have django application with channels. It opens websocket connection to Crypto-market data provider. I received tick data, I insert those ticks in the database.
I also want to send that tick data to ...
0
votes
0
answers
18
views
Django socketio history
I am trying to do a chat app in django with socketio. I tried to do it from this video. I did it but how can I add history to the chat with consume the least space in my computer? With history I mean ...
-1
votes
0
answers
12
views
how to get employee tracking sites urls uptodate using django channels
I have a django project that tracked the urls when user visit.
iwant to display the list of urls update without a refresh
how this possible using django channels and web sockets
0
votes
0
answers
23
views
Both logging and print statements inside django channels consumer are not working
I'm trying to integrate celery with django channels but channels consumer is not working as it supposed. Logging or prints inside consumer functions are not displaying message in terminal.
The ...
0
votes
1
answer
133
views
The Cross Origin Opener Policy header has been ignored - DJANGO
Im making a Chatapp project in Django. I implemented channels and websockets to send and receive message and this worked when i tested using two differents windows in the same browser (one of them in ...
-2
votes
0
answers
13
views
Djangochannelsrestframework hot to send image file?
How can I send image file by websocket using djangochannelsrestframework?
Thanks!
0
votes
0
answers
13
views
Could I use memcached as a channel layer in Django?
I would like to use Django Channels in my application and I need a channel layer but I don't want to use Redis because, it is not available in my hosting plan. I have to get a dedicated or VPS server ...
0
votes
0
answers
73
views
module not found 'core' error when deploying django with django channels on heroku
I have been trying to deploy my application on heroku with django channels and I always get the following error
2022-05-26T20:09:58.137436+00:00 app[web.1]: ModuleNotFoundError: No module named 'core'
...
0
votes
0
answers
27
views
I am new to Django and I can't understand a few errors related to os.environ.setdefault
I found a GitHub repo for reference and practice but when I'm trying to run it on my system it is giving me this error:
Traceback (most recent call last):
File "C:\Users\Nikita\Desktop\GitHub ...
1
vote
0
answers
34
views
Django channel convert to live score board
By following Django Channel documentation I successfully ran a simple app that can two way communicate between client and server. I have three pages with a button and variable (c1,c2,c3) respectively ...
0
votes
1
answer
39
views
Using Django Channels (websocket layer consumer) to update a webpage with data from an internal database and external an data source
I have the following django channels class which updates values on a webpage webpage. The class receives data from screen clicks, performs actions (toggling indicdual relays or setting a series of ...
0
votes
0
answers
47
views
Websocket not working with django on deployment
i hope that u can help me.
I deployed my django application to an ubuntu 20.04 server with nginx and gunicorn.
This is my settings:
gunicorn.service
[Unit]
Description=gunicorn daemon
Requires=...
0
votes
0
answers
24
views
Not able to connect with server websocket it showing me status -502 Bad Gateway in django
I have configure Django Channels successfully in my local it is working fine in my local, also I'm able to chat one to one using websocket. when I try to deploy it to server and try to connect with ...
0
votes
1
answer
40
views
Djangochannelsrestframework doesn't work like in documentation
I'm trying to create websocket connection with djangochannelsrestframework. I tried all like in documentation and I got this error
"django.core.exceptions.AppRegistryNotReady: Apps aren't loaded ...
0
votes
0
answers
23
views
how to make a websocket connection to dynamic url from the javascript?
I have a all_products_page.html(super admin side) where i'm getting products of all the user.
In this page there is a column named 'status'. on which i'm sending an ajax request to approve or ...
0
votes
1
answer
57
views
What is the proper documentation for using django channels on azure app services?
I am trying to deploy a web app on azure app service
All the http request work just fine as one would expect
there just one problem none of the websockets work
I am using in memory channels version 2....
1
vote
0
answers
40
views
A better solution for the increasing number game?
I am remaking the question I made here based on the feedback given to me. If there is still something unclear in my question please let me know.
Explanation for the game: Increasing number game where ...
0
votes
1
answer
20
views
Channels django nginx 502
I ran into a problem once I install and add "channels" to the settings and after that to the asgi file. Server crashes, I get 502 and nginx won't start. How can I add these channels and ...
0
votes
0
answers
27
views
getting ModuleNotFoundError at /admin/login/. How to solve this error
While login in as a superuser getting this error. Below I have mentioned the installed app and middleware in settings.py and I have gotten the error named ModuleNotFoundError.
Exception Type: ...
0
votes
0
answers
37
views
how to setup daphne with nginx with djnago channels for websockets
I have to set up the Django server with WebSockets and HTTP requests. It works fine in my local system. and also on the server without SSL, but when we use the SSL on the server the HTTP request works ...
0
votes
0
answers
16
views
Django Channels. How to create a variable (or a object) that can live only during the WebSocket?
I have a websocket and i want to create a global variable that lives during all the life time of the websocket itself. The main issue is that the variable is actually shared between all the client ...
0
votes
0
answers
72
views
How to save or record live video feed received as bytes in django channels
I am buildings a security camera project for my finals, what i am doing is send frames from an esp32-cam to django channels websocket endpoint ws/video
I successfully manage to receive and display the ...
0
votes
1
answer
58
views
Not Implemented Error in Django Channels Layers
I was following the Django channels tutorial to create a simple chat application.
But while trying to check if the channel layer can connect to Redis, I get this Not Implemented Error.
>>> ...
0
votes
0
answers
29
views
Other websockets does not work when a websocket is pending
I use Django Channels and I have multiple websocket addresses. When I connect to a websocket, it gets and computes somethings from database and this process may take 10 seconds. But during this 10 ...
0
votes
0
answers
22
views
Django send full QuerySet in Channels
I am using Django Channels to build a game. It's a super simple multiplayer chance game. After user clicks a button the game starts and the server receives the data via Channels. I do the necessary ...
0
votes
0
answers
28
views
Changing front-end image based on back-end variable change without reloading page in django
I'm using Django framework to monitor garbage fill ratio. I' m getting the data via IOT device with Raspberry Pi. So when the sensor data change, I want to change the image on front-end without page ...
0
votes
0
answers
107
views
Django channel group_send all messages to one channel in the group
I am trying to make a real time chat web app with Django channel. When I am trying using Postman build multiple WS connections with it. I encountered some weird thing, let's say I have 2 connections ...
0
votes
0
answers
69
views
Why do I get errors when starting Daphne for prod / IIS?
I'm using Django eventstream for SSE and Channels (I'm not able to use Memurai or Redis). When I run the local server, everything works great. The user can submit a file, that information is ran ...
0
votes
2
answers
129
views
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 ...
0
votes
0
answers
87
views
Exception inside application: 'user' user=self.scope['user'] KeyError: 'user'
I'm trying to set up a custom middleware for my django channels since AuthMiddleWare returns anonymousUser while trying to use self.scope['user] in consumers.py and i'm using token based ...
0
votes
0
answers
15
views
Django Channels - Callback on receiving ping (0x9) message
I am running a Golang application that sends a standard ping (0x9) message at some interval and my Django backend responds to it just how it is described HERE.
And I want to track if the Golang client ...
0
votes
2
answers
41
views
django websocket cannot send data to client after receiving it
class WSTestView(WebsocketConsumer):
def connect(self):
self.accept();
self.send(json.dumps({'status': 'sent'})) # client receives this
def receive(self, text_data=None, ...
0
votes
1
answer
47
views
Django not redirecting to the web page
I am creating a messaging application in django with a built-in DLP system. I want to redirect to a web page when a sensitive word is detected in the message. But the webpage is not being redirected ...