Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django-Celery: djkombu_queue table no created

EDIT 2
If someone can just post what the schema is supposed to be, I'd be more than happy! I just need to know the table names and column names!

I'm following along this tutorial:

http://www.caktusgroup.com/blog/2014/06/23/scheduling-tasks-celery/

I've pip installed django-celery successfully.

#settings.py
import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'charts',
'social.apps.django_app.default',
'django.contrib.staticfiles',
'djcelery',
'kombu.transport.django',
)

When I run python manage.py syncdb:

Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table social_auth_usersocialauth
Creating table social_auth_nonce
Creating table social_auth_association
Creating table social_auth_code
Creating table celery_taskmeta
Creating table celery_tasksetmeta
Creating table djcelery_intervalschedule
Creating table djcelery_crontabschedule
Creating table djcelery_periodictasks
Creating table djcelery_periodictask
Creating table djcelery_workerstate
Creating table djcelery_taskstate

However, when I run python manage.py celery worker --loglevel=info I end up with:

OperationalError: no such table: djkombu_queue

I've tried uninstalling and reinstalling everything, but have not been able to figure out why this table is not being created. How does one get this table created?

EDIT I asked this question after looking at the other question because changing settings to:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'charts',
'social.apps.django_app.default',
'djcelery',
'kombu.transport.django',
'djcelery.transport',

)

OR

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'charts',
'social.apps.django_app.default',
'djcelery',
'djcelery.transport',
)

Still results in:

Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table social_auth_usersocialauth
Creating table social_auth_nonce
Creating table social_auth_association
Creating table social_auth_code
Creating table celery_taskmeta
Creating table celery_tasksetmeta
Creating table djcelery_intervalschedule
Creating table djcelery_crontabschedule
Creating table djcelery_periodictasks
Creating table djcelery_periodictask
Creating table djcelery_workerstate
Creating table djcelery_taskstate

However the djkombu_queue is still missing...

like image 548
DataSwede Avatar asked Oct 07 '14 19:10

DataSwede


2 Answers

Had been stuck with the same thing since 6 days...The following finally solved it for me :-

pip install django-kombu

and then adding djkombu to INSTALLED APPS :-

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'djcelery',
    'djkombu',
    'app1',
    'app2',
    'app3',
    'app4',
)

Then a fresh syndb:-

python manage.py syncdb

You can check the schema with :-

python manage.py sqlall djkombu
like image 136
apratimankur Avatar answered Nov 06 '22 17:11

apratimankur


According to current Celery documentation it is necessary to include kombu.transport.django into installed apps:

INSTALLED_APPS += ["kombu.transport.django"]
like image 1
prokher Avatar answered Nov 06 '22 16:11

prokher