Tag Archives: Django Configurate celery error

[Solved] Django Configurate celery error: django.db.utils.DatabaseError

Error on execution of asynchronous task: 

django.db.utils.DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias ‘default’ was created in thread id 3047101641304 and this is thread id 3047208084584.

 

Solution:

Original start command (under Windows):
celery -A xxx worker -l info -P eventlet (xxx is the project name)
Modified start command, celery version 4x:
celery -A xxx worker -l info -P solo