J
J
Jekson2019-08-09 09:41:54
Django
Jekson, 2019-08-09 09:41:54

How to properly set up a WSGI and ASGI server for a Django application?

I first encountered Django channels on a project and, unfortunately, I have no idea how to set up a production server, taking into account the presence of chanels.
When I deployed the project locally and ran manage.py runserver, I noticed that the console displays

Starting ASGI/Channels version 2.1.6 development server at http://127.0.0.1:8000/

instead of the usual WSGI
I deployed the project to an Ubuntu server using Nginx+uwsgi, as I usually did before to work with WSGI. Not all pages work, there were errors on UWSGI, and when I started digging, I realized that I needed a separate script server for ASGI, such as Daphne.
Tell me the steps to run both options in parallel, or now I don’t need uwsgi and I need to leave only daphne, how does django understand what to work with? Maybe you have your own working Nginx setup config with uwsgi and daphne?
In general, I will be grateful for any help in understanding this issue.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-08-09
@Lepilov

https://channels.readthedocs.io/en/latest/deployin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question