socketify.py icon indicating copy to clipboard operation
socketify.py copied to clipboard

Django - You cannot call this from an async context

Open glanzel opened this issue 1 year ago • 2 comments

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 grafik

Versions:

  • Socketify 0.31
  • django 5.1.2

glanzel avatar Oct 30 '24 22:10 glanzel

thanks for reporting will take a look.

cirospaciari avatar Oct 30 '24 23:10 cirospaciari

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.

mobilemodula avatar Jan 28 '25 20:01 mobilemodula