0

When i putted my project on production even with runserver test this error did not raised but when i used gunicorn --bind for test this happens

import os from celery import Celery

# Set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sqh.settings.dev')

app = Celery('sqh',broker_url = 'redis://localhost:6379/0')

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django apps.
app.autodiscover_tasks()


#@app.task(bind=True)
#def debug_task(self):
#    print(f'Request: {self.request!r}')

ImportError: cannot import name Celery

Hamedio
  • 65
  • 9
  • Welcome to Stack Overflow. We can only help you with error messages that you actually show to us. Please read https://meta.stackoverflow.com/questions/359146/why-should-i-post-complete-errors-why-isnt-the-message-itself-enough, and also read the [formatting help](https://stackoverflow.com/help/formatting) and make sure that your code appears exactly as you have it. – Karl Knechtel Sep 04 '21 at 08:04
  • I think there's a similar issue at https://stackoverflow.com/questions/19926750/django-importerror-cannot-import-name-celery-possible-circular-import check it – George Efthymiou Sep 04 '21 at 08:14

0 Answers0