redis.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .. _broker-redis:
  2. =============
  3. Using Redis
  4. =============
  5. .. _broker-redis-installation:
  6. Installation
  7. ============
  8. For the Redis support you have to install additional dependencies.
  9. You can install both Celery and these dependencies in one go using
  10. ehter the `celery-with-redis`_, or the `django-celery-with-redis` bundles::
  11. $ pip install -U celery-with-redis
  12. .. _`celery-with-redis`:
  13. http://pypi.python.org/pypi/celery-with-redis
  14. .. _`django-celery-with-redis`:
  15. http://pypi.python.org/pypi/django-celery-with-redis
  16. .. _broker-redis-configuration:
  17. Configuration
  18. =============
  19. Configuration is easy, set the transport, and configure the location of
  20. your Redis database::
  21. BROKER_URL = "redis://localhost:6379/0"
  22. Where the URL is in the format of::
  23. redis://userid:password@hostname:port/db_number
  24. .. _redis-results-configuration:
  25. Results
  26. -------
  27. You probably also want to store results in Redis::
  28. CELERY_RESULT_BACKEND = "redis"
  29. CELERY_REDIS_HOST = "localhost"
  30. CELERY_REDIS_PORT = 6379
  31. CELERY_REDIS_DB = 0
  32. For a complete list of options supported by the Redis result backend see
  33. :ref:`conf-redis-result-backend`
  34. If you don't intend to consume results you should disable them::
  35. CELERY_IGNORE_RESULT = True