Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings:
- REDIS_HOST = '0.0.0.0'
- REDIS_PORT ='6378'
- CELERY_BROKER_URL = 'redis://' + REDIS_HOST + ':' + REDIS_PORT + '/0'
- CELERY_BROKER_TRANSPORT_OPTIONS = {'visibility_timeout':3600}
- CELERY_RESULT_BACKEND = 'redis://' + REDIS_HOST + ':' + REDIS_PORT + '/0'
- CELERY_ACCEPT_CONTENT = ['application/json']
- CELERY_TASK_SERIALIZER = 'json'
- CELERY_RESULT_SERIALIZER = 'json'
- celery.py:
- import os
- from celery import Celery
- from celery.schedules import crontab
- os.environ.setdefault('DJANGO_SETTINGS_MODULE','cel.settings')
- app = Celery('cel')
- app.config_from_object('django.conf:settings', namespace='CELERY')
- app.autodiscover_tasks()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement