Throw the following DatabaseError in Django 1.5.1 (and 1.5.0) and mysql when I start the server and try to load the local version of the web application:
DatabaseError in /
DatabaseWrapper objects created in the stream can only be used on this same thread. An object with the alias 'default' was created in stream identifier 4365488128, and this is stream identifier 140735183980896.
The exception location is as follows:
/Users/USERNAME/.envs/PROJECT_NAME/lib/python2.7/site-packages/django/db/backends/ INIT .py in validate_thread_sharing, line 154
This only happens when the first page loads. When I click update, the web application loads as expected. The error is returned when I modify the Django / python code and the local server needs to be re-checked. When this happens, the first load throws DatabaseError again and the subsequent loads again.
This problem only occurs in my Django 1.5 projects. I uninstalled mysql and cleared the mysql binaries located in / usr / local / var / mysql. A new mysql installation did not solve this problem.
A similar DatabaseError is discussed here, but I cannot execute their solution:
https://code.djangoproject.com/ticket/17998
I do not understand here, any ideas or experience will be appreciated. Thanks.
daroo source share