socketify.py
socketify.py copied to clipboard
Django - You cannot call this from an async context
Describe the bug When running a Django App with socketify Djnago says: You cannot call this from an async context - use a thread or sync_to_async
To Reproduce Steps to reproduce the behavior:
git clone [email protected]:deparkes/simple-django-app.git
cd simple-django-app/cool_counters
python manage.py migrate
pip install socketify
python3 -m socketify cool_counters.wsgi:application --interface wsgi -w 2
open 127.0.0.1:8000
Expected behavior See an simple html page with a counter
Screenshots
Versions:
- Socketify 0.31
- django 5.1.2
thanks for reporting will take a look.
Same issue here, seems like Django is kinda mixed about sync and async operations, like some of its core is completely sync, and almost it's whole ORM async, so at first this makes things a little more complex. I'll come back when I have any news.