I have this in my /var/log/celery/w1.log
I'm following the steps for Celery here.
I have this in my celery.py
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
# Set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sample.settings')
app = Celery('sample2',
broker='amqp://',
include=['sample2.tasks'])
# 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')
if __name__ == '__main__':
app.start()
what can I do to fix this? Thanks in advance.
Full document in this link.
you should just add the below line to init.py near settings.py
from .celery import app as celery_app
__all__ = ['celery_app']
project structure
- proj/
- manage.py
- proj/
- __init__.py
- settings.py
- urls.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With