Questions tagged [daphne]

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

259 questions
44
votes
1 answer

Django 3.x - which ASGI server (Uvicorn vs. Daphne)

I have a simple API-based web application written in Django 3. In the Django documentation there is a page about ASGI servers, and two options are mentioned: Daphne and Uvicorn. Unfortunately, they do not provide any description about the benefits…
rafaljusiak
  • 1,050
  • 1
  • 10
  • 17
27
votes
3 answers

Django daphne asgi: Django can only handle ASGI/HTTP connections, not websocket

This is really frustrating, I did set everything up according to the documentation, but daphne keeps throwing an error when I try to run it independently, it does work correctly when I use python manage.py run server. this is very frustrating and I…
SenseofDeath
  • 271
  • 1
  • 3
  • 5
22
votes
3 answers

Django Channels Nginx production

I have a django project and recently added channels to use websockets. This seems to all work fine, but the problem I have is to get the production ready. My setup is as follows: Nginx web server Gunicorn for django SSL enabled Since I have added…
Harry
  • 13,091
  • 29
  • 107
  • 167
18
votes
2 answers

How to profile django channels?

My technology stack is Redis as a channels backend, Postgresql as a database, Daphne as an ASGI server, Nginx in front of a whole application. Everything is deployed using Docker Swarm, with only Redis and Database outside. I have about 20 virtual…
Valar
  • 1,833
  • 1
  • 16
  • 18
16
votes
1 answer

Run simultaneously UWSGI and ASGI with Django

I'm currently running a Django (2.0.2) server with uWSGI having 10 workers I'm trying to implement a real time chat and I took a look at Channel. The documentation mentions that the server needs to be run with Daphne, and Daphne needs an…
Pyvonix
  • 757
  • 9
  • 22
14
votes
1 answer

ModuleNotFoundError: No module named 'django.utils.six'

HTTP GET /admin/ 500 [0.00, 127.0.0.1:51425] Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\daphne\http_protocol.py", line 180, in process "server":…
mukluk
  • 151
  • 1
  • 1
  • 5
14
votes
4 answers

Deploying Django Channels with Daphne + NGINX using SSL

I had a working configuration of nginx proxying to an upstream daphne server for django channels. However, when I moved my site to ssl, I started running into issues 403 errors with the websocket requests. This is from my error log: None - -…
Lauren
  • 281
  • 2
  • 7
14
votes
3 answers

Require login in a Django Channels socket?

I'm trying out Channels in Django 1.10 and set up a few consumers. I tried creating a login_required decorator for it that closes the connection before executing it to prevent guests from entering this private socket. Also integrated unit tests…
Sergio E. Diaz
  • 396
  • 3
  • 15
12
votes
2 answers

systemctl strange error: Invalid arguments

Here's my service file: [Unit] Description=Daphne Interface [Service] ExecStartPre=cd /home/git/hsfzmun/server ExecStart=/bin/bash/ -c "cd /home/git/hsfzmun/server && /home/git/virtualenvs/hsfzmun/bin/daphne -b 0.0.0.0 -p 8001 -v2…
hsfzxjy
  • 1,242
  • 4
  • 14
  • 22
11
votes
2 answers

Configuring Supervisor for Daphne (Django Channels)

I have created a web application with Django Channels which I face problems with while trying to set up with Supervisor system. To start with, the application locally works well. Remotely (I use an AWS EC2 instance with Ubuntu Server 18.04 LTS),…
11
votes
2 answers

Deploy to docker with nginx, django, daphne

I want to deploy my service to docker. and my service is developed using python+django and django-channels ── myproject ├── myproject │ ├── settings.py │ ├── urls.py │ ├── asgi.py │ ├── ... ├── collected_static │…
user3643465
10
votes
1 answer

Uvicorn async workers are still working synchronously

Question in short I have migrated my project from Django 2.2 to Django 3.2, and now I want to start using the possibility for asynchronous views. I have created an async view, setup asgi configuration, and run gunicorn with a Uvicorn worker. When…
physicalattraction
  • 6,485
  • 10
  • 63
  • 122
10
votes
1 answer

How to run wsgi along the side of the daphne ASGI for django channels

i am using django channels in my project using using official django channels v2, my simple channels app is completed and working fine if run python manage.py runserver but i want to run django channels in different port so i am now using…
karnataka
  • 425
  • 1
  • 4
  • 14
9
votes
3 answers

SynchronousOnlyOperation Error in with django 3 and django channels

I had a django 2 app and i used django channels for socket connection. i just update django to version 3. and now daphne show this error when i try to make a socket connection. i had not any problem with django 2. [Failure instance: Traceback:…
AlexMercer
  • 301
  • 3
  • 10
9
votes
1 answer

How to bind Daphne on a unix socket?

So far, I've used Gunicorn, with this configuration file systemd: [Unit] Description=gunicorn…
Narnik Gamarnik
  • 1,049
  • 1
  • 16
  • 35
1
2 3
17 18