Questions tagged [django-channels]
Should be used for the django-channels project that brings asynchrony (WebSockets and HTTP2) to django.
django-channels
1,652
questions
0
votes
0
answers
29
views
WebSocket Channels in Django not connecting
I'm struggling why still insist not being connected my WebSocket using Django, I've used laragon as Mysql and I just used my local database, and I just want to try first before saving to database it ...
0
votes
0
answers
16
views
how to send content from celery task to websucket
please i am trying to process some data in a celery task and pass it to websucket connection to the clientside but the bellow code deosnt seam to be doing what i intend to achieve .
Consumers.py file
...
0
votes
0
answers
26
views
Managing Inconsistent Model Attribute State on WebSocket Reconnect (Django Channels)
I'm working on an online battleship game with React Django_channels and i'm having problems maintaining data consistency of a "lobby phase" attribute in my Django model, this attribute ...
0
votes
0
answers
22
views
Get "RuntimeError: Event loop is closed" while running pytest in django channels
I wrote a test for my websocket connection.
Here is my pytest code.
import pytest
from channels.testing import WebsocketCommunicator
from django.contrib.auth import get_user_model
from ...
0
votes
0
answers
10
views
how to obtain a pop-up or system alert when my timer ends in Django
I have a task-timer app, the timer model has an attribute "end" that takes in timefield by generics.createAPIview. I want to add a feature using signals such that, when the timers end time ...
0
votes
0
answers
12
views
Django Channels - Live Chat does not Update Messages
Very new to Django and channels. I tried to create a channel system for users to chat with other users, one-on-one. What should I do? I'm also not sure if this is a Javascript thing or the consumers....
0
votes
0
answers
36
views
How to connect multiple authenticated clients' with Django channels and clients should be connected before opening the channels?
So I'm working on a desktop based app that requires a socket to handle multiple authenticated clients with a Django channel, and clients should be authenticated by the server before opening the ...
0
votes
1
answer
26
views
django-channels integration tests with pytest?
I am trying to create a simple live-server style test fixture for pytest for testing with django-channels. I came up with the simplest solution:
import pytest
@pytest.fixture(scope="function&...
0
votes
0
answers
12
views
Django proyect tring to integrate asgi
I have a django proyect that works with views and django-rest-framework and now i want to add channels to it.
I have a django proyect that works with views and django-rest-framework and now i want to ...
1
vote
1
answer
70
views
What is the purpose of using daphne with django channels?
What is the primary purpose of using Daphne with Django channels, if we can already do the ASGI configuration ourselves? What is the relationship between ASGI & Daphne server?
0
votes
0
answers
23
views
ModuleNotFoundError: No module named 'users.routing.websocket_urlpatterns'; 'users.routing' is not a package
I am tring to setup realtime connection between User Dashboard and Admin Dashboard for Notifications.
This is my backend/asgi.py
import os
from django.core.asgi import get_asgi_application
from ...
1
vote
1
answer
64
views
How to know user is online/offline with django channels?
With Django Channels, can you track which users are online or offline throughout your website? Should every page have a websocket connection? And when a user is online/offline, how can I show the user ...
5
votes
2
answers
202
views
WebSocket connection to 'wss://example.com/wss/' failed in Django Channels
I'm trying to set up a WebSocket connection using Django Channels in my Django project. However, I keep encountering an error when trying to connect from the frontend JavaScript. The error message in ...
0
votes
0
answers
28
views
how to Implement non-blocking, sequential AI moves in a multiplayer chess game in django channels?
I'm developing a website to play a special with kind of chess with React and Django.
It pretty much requires two games to be played at the same time. The website allows to add AI players, so the ...
0
votes
0
answers
33
views
TypeError: Group name must be a valid unicode string with length < 100 containing only ASCII alphanumerics, hyphens, underscores, or periods, not
import json
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
from .models import User, Connection, Message
import logging
from .serializers import (
...