How to check if server is running in ASGI or in WSGI mode?

314 views
Skip to first unread message

Rafis Ganeev

unread,
Jul 19, 2018, 5:12:22 PM7/19/18
to Django users
We are running same django project in WSGI mode for handling HTTP requests and in ASGI mode for handling WebSockets. For WSGI mode we are using **gunicorn3** server:

    gunicorn3 --pythonpath . -b 0.0.0.0:8000 chat_bot.wsgi:application

For ASGI mode we are using **daphne** server:

    daphne --root-path . -b 0.0.0.0 -p 8001 chat_bot.asgi:application

How to programatically detect which mode currently is running **GUnicorn+WSGI** or **Daphne+ASGI**?

Andrew Godwin

unread,
Jul 22, 2018, 12:51:59 PM7/22/18
to django...@googlegroups.com
Where do you want to detect this? There's no official way of knowing, because you're meant to detect based on features/what gets called.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4ec22aa6-e69e-4cb6-8463-d3a9eef4728e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages