7

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...

Chillar Anand
  • 27,936
  • 9
  • 119
  • 136
DataSwede
  • 5,251
  • 10
  • 40
  • 66
  • Add `djcelery.transport` to installed apps and do syncdb again. – Chillar Anand Oct 08 '14 at 02:45
  • possible duplicate of [Why are celery\_taskmeta and other tables not being created when running a syncdb in django?](http://stackoverflow.com/questions/6959702/why-are-celery-taskmeta-and-other-tables-not-being-created-when-running-a-syncdb) – Chillar Anand Oct 08 '14 at 02:46
  • it's very similar, but using the same fix did not solve my problem. See update. – DataSwede Oct 08 '14 at 13:21

4 Answers4

6

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
apratimankur
  • 783
  • 1
  • 5
  • 10
1

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

INSTALLED_APPS += ["kombu.transport.django"]
azalea
  • 11,402
  • 3
  • 35
  • 46
prokher
  • 490
  • 5
  • 18
0

try this:

add djcelery.transport in installed_apps

INSTALLED_APPS = ('djcelery.transport', )
Avinash Garg
  • 1,374
  • 14
  • 18
0

Something has broken between various versions of Django, Django-Celery, and Kombu when trying to generate the tables.

I managed to find that Django 1.6.5, django-celery 3.1.16, and Kombu 3.0.21 WORKS.

DataSwede
  • 5,251
  • 10
  • 40
  • 66