Hello Django community,
I would like to deploy a Django project in production using channels and Daphne only. I was successful at using django, nginx, gunicorn and daphne in the past but would like to try to use daphne alone with django. Is this possible? How can I implement this via https/certbot? My site works using daphne -b 0.0.0.0 -p 8001 project_name.asgi:application on the command line but I need to do this in production via a systemd service. Also having an issue getting static files to work but this could be another post. Static files work fine via python manage.py runserver x.x.x.x:port with debug on or off in settings but not using channels.
Thanks
Marc
Is it possible? Yes.
Is it something you want to do? Not really.
You don’t gain anything by avoiding nginx, but you potentially add a lot of load on your server by making your Django code do things that are much more efficiently handled by a web server.
Hello Ken,
Thank you for the response. Are there any updated tutorials you can point me to that detail channels/daphne integration with nginx? Will I still need to use gunicorn or another application.? I have redis installed on the server.
Thanks
Marc
I’m not aware of any. There are some samples here in the “Deployment” section of the forum where we’ve worked through configuration issues associated with this, but I don’t know of any external resources that cover everything. (One such example is at This is my current configuration on my digital ocean droplet:)
It’s your choice. You can configure Daphne to serve both your Django app and Channels, or you can separate them into two different services. (That’s what we do.) If you do break them apart (which I personally recommend), then you would use something like uwsgi (what we use) or gunicorn.
Our standard deployment of our Channels-based projects includes nginx, uwsgi, Daphne, redis, memcached, PostgreSQL, and (optionally) Celery worker, Celery Beat, and Channels worker(s).
Thank you Ken I appreciate it.