How configure ASGI instead of default WSGI

Doulos

New Member
#1
First of all say that my django based project using celery works wonderfully on openlitespeed.
However, I have a new requirement that requires me to use django channels to send asynchronous messaging. For this I must stop using WSGI that comes by default in the openlitespeed template and change to ASGI. I've been checking the web and I can't find any documentation about it. Gunicorn or uvicorn is recommended as they say that not all servers support ASGI. I love openlitespeed and I already have my server with several other things configured, I wouldn't want to change. Can someone tell me if openlitespeed supports ASGI, and if it does, how can I change from WSGI to ASGI? Thank in advance.
 

Doulos

New Member
#3
Sorry, I am new to ols, I have a virtual host, the default one "Example" I just replaced de default Django app with mine. I have searching on the web and I can't find a way of doing that, a reverse proxy to Django ASGI. could you please help me? I also don't know what to do with my actual website running on Example virtual host. My site is currently in production, I can stop it one day maybe to do the change, but I don't know what could be the best approach in order to don't mess all up. I can do a snapshot of the server. Could you please give any clue. In last case, how could I temporary disable OLS so I could try nginx ? For nginx with unicorn and uvicorn there is some documentation.
 

Doulos

New Member
#5
Do you want to use the production site and Django with the same domain?
To set up a reverse proxy, you don't need to stop anything, please check https://docs.openlitespeed.org/docs/advanced/proxy setup guide.
A `service lsws stop` could stop it, but you don't have to do it. Simply change the listener port number, so it won't conflict with other web servers.
Yep, the site currently on production is running with Django using wsgi, but I introduced a functionality with web sockets and need to use asgi instead. I am using a default OLS template that comes with a Django virtual host predefined using wsgi. There I am serving my statics files too. I want to try doing a reverse proxy to gunicorn with uvicorn. So, if I get it, you suggest me to modify the first virtual host to run in ports different to 80 and 443, so I could try the new virtual host configuration. I am right. Thanks again
 
Top