DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. #719
Replies: 4 comments
-
I don't use Django a lot, but based on the error message this means that you are passing a model object obtained in one thread to another thread, which is actually not a valid use case. What you need to do is pass the object id to the other thread, so that it can load the object from the database directly in that same thread. This error is unrelated to this package, by the way. It's just that this package uses threads so you have to be careful about the threading requirements in Django ORM. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, with python 3.8 too. @praveenydv did you resolved it? |
Beta Was this translation helpful? Give feedback.
-
I discover a solution. If you append
In my project works. Hope you works too! :) |
Beta Was this translation helpful? Give feedback.
-
I'm running into this same issue, but preload isn't working. Has anyone else ran into this, and if so, did it help? |
Beta Was this translation helpful? Give feedback.
-
my wsgi.py:
my websocketserver.py
when I run command :
then I am getting error on send_mssg event:
I have checked that when I call send_mssg event then It gives error when new message instance is creating...
How to solve this??
Plz help!!!
Beta Was this translation helpful? Give feedback.
All reactions