Advertisement
Guest User

Untitled

a guest
Mar 24th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. settings:
  2. REDIS_HOST = '0.0.0.0'
  3. REDIS_PORT ='6378'
  4. CELERY_BROKER_URL = 'redis://' + REDIS_HOST + ':' + REDIS_PORT + '/0'
  5. CELERY_BROKER_TRANSPORT_OPTIONS = {'visibility_timeout':3600}
  6. CELERY_RESULT_BACKEND = 'redis://' + REDIS_HOST + ':' + REDIS_PORT + '/0'
  7. CELERY_ACCEPT_CONTENT = ['application/json']
  8. CELERY_TASK_SERIALIZER = 'json'
  9. CELERY_RESULT_SERIALIZER = 'json'
  10.  
  11. celery.py:
  12. import os
  13. from celery import Celery
  14. from celery.schedules import crontab
  15.  
  16.  
  17. os.environ.setdefault('DJANGO_SETTINGS_MODULE','cel.settings')
  18.  
  19. app = Celery('cel')
  20. app.config_from_object('django.conf:settings', namespace='CELERY')
  21. app.autodiscover_tasks()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement