3 ms·
Django is agnostic about its actual connection to the webserver. It provides a basic wsgi adapter (wsgi is the Python spec for delivering HTTP requests to an a
by nostrademons 11y ago
Django is agnostic about its actual connection to the webserver. It provides a basic wsgi adapter (wsgi is the Python spec for delivering HTTP requests to an app and sending responses back to the client), which can be plugged into any wsgi container. When HTTP requests arrive at the wsgi container, it forwards them on to Django's entry point, which runs the normal routes/views/middleware/etc.
When I first got into Django in 2007 the preferred container was flup, using an scgi connection to the webserver. Nowadays, it seems like uwsgi over HTTP is preferred. CGI was an option for deployment since inception, but I don't know anyone that actually ran their Django apps over CGI, since it's many times slower than using uwsgi.
Django Channels extends wsgi into asgi (ASynchronous Gateway Interface), which provides both send() and receive_many() callables to the application server. In other words, Django can now send messages, unsolicited, back to the webserver, which presumably has a websocket connection back to the browser.