celery / django-celery-results

Celery result back end with django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: No module named 'tokensdjango_celery_results'

rjrjaleco-dev opened this issue · comments

I freshly installed celery along with django-celery-results. Following documentation, I added django_celery_results to the installed apps, and I migrate my django app with the command:

$ python3 manage.py migrate django_celery_results

The migration fails because of the following error:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/user/.local/share/virtualenvs/api-pum_oDtt/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/home/user/.local/share/virtualenvs/api-pum_oDtt/lib/python3.8/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/home/user/.local/share/virtualenvs/api-pum_oDtt/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/user/.local/share/virtualenvs/api-pum_oDtt/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/home/user/.local/share/virtualenvs/api-pum_oDtt/lib/python3.8/site-packages/django/apps/config.py", line 228, in create
    import_module(entry)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tokensdjango_celery_results'

Did I miss something?

django settings:

CELERY_RESULT_BACKEND = 'django-db'
CELERY_BROKER_URL = 'amqp://localhost'

celery.py

from __future__ import absolute_import, unicode_literals
import os
from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')

app = Celery('api')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

celery versions

celery==5.2.7
django-celery-results==2.3.1

ModuleNotFoundError: No module named 'tokensdjango_celery_results' -- in your installed app settings, put a comma after tokens,

Thank you. I oversaw the missing comma.