Open gschurck opened 10 months ago
I have a similar problem :(
You should try running Django using an actual ASGI server such as uvicorn
like:
pip install uvicorn
python -m uvicorn my_django_project.asgi:application
Not sure if it will fix your problem but per the Django docs:
Serving with ASGI in development Django’s runserver command provides a WSGI server. In order to run under ASGI you will need to use an ASGI server. The Django Daphne project provides Integration with runserver that you can use.
It could be the development server is messing up the asyncio
event loop.
Description
I try to use async redis cache in Django (synchronous is working fine)
What I Did
The command
manage.py runserver 8000
And when requesting the view, it only works literally half the time. Like working, then error, then working, then error, etc... Not sure if the error comes from the lib or my async code. Here is the traceback for the error
RuntimeError: Event loop is closed
: