redis.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. either the `celery-with-redis`_, or the `django-celery-with-redis` bundles:
  11. .. code-block:: bash
  12. $ pip install -U celery-with-redis
  13. .. _`celery-with-redis`:
  14. http://pypi.python.org/pypi/celery-with-redis
  15. .. _`django-celery-with-redis`:
  16. http://pypi.python.org/pypi/django-celery-with-redis
  17. .. _broker-redis-configuration:
  18. Configuration
  19. =============
  20. Configuration is easy, just configure the location of
  21. your Redis database::
  22. BROKER_URL = 'redis://localhost:6379/0'
  23. Where the URL is in the format of::
  24. redis://:password@hostname:port/db_number
  25. all fields after the scheme are optional, and will default to localhost on port 6379,
  26. using database 0.
  27. .. _redis-results-configuration:
  28. Results
  29. -------
  30. If you also want to store the state and return values of tasks in Redis,
  31. you should configure these settings::
  32. CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
  33. For a complete list of options supported by the Redis result backend, see
  34. :ref:`conf-redis-result-backend`