django / channels

Developer-friendly asynchrony for Django

Home Page:https://channels.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

djangochannelsrestframework working with gunicorn

AndreaMascoli opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I've a project where i use gunicorn in prod environment. I saw that gunicorn is an application server used only for WSGI mode, so it can't substitute something like Daphne. I've implemented in dev environment the consumers and the websocket connection with them, and all seems to work good using only 'python manage.py runserver' and the configuration found on internet to use daphne and djangochannelsrestframework. I know that daphne was projected to work efficiently with channels library. The problem is that i have to repropose this functionality also in prod env and i have to necessarily use gunicorn. On the web i read that is possible to run gunicorn and Uvicorn as a worker class in order to manage the asgi functionality. The possible solutions that i think i can implement are one of this two:
1 Make djangochannelsrestframework work with uvicorn
2 Run gunicorn and daphne in certain way similar to the uvicorn working class
So the questions are : is possible to implement at least one of these solutions ? Which would be the best one?

Describe the solution you'd like
I want to run gunicorn server and make work consumers and websocket implemented with daphne

Describe alternatives you've considered
1 Make djangochannelsrestframework work with uvicorn
2 Run gunicorn and daphne in certain way similar to the uvicorn working class

You should be able to use uvicorn without issue.