mongodb.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .. _broker-mongodb:
  2. ===============
  3. Using MongoDB
  4. ===============
  5. .. _broker-mongodb-installation:
  6. Installation
  7. ============
  8. For the MongoDB 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-mongodb`_, or the `django-celery-with-mongodb` bundles:
  11. .. code-block:: bash
  12. $ pip install -U celery-with-mongodb
  13. .. _`celery-with-mongodb`:
  14. http://pypi.python.org/pypi/celery-with-mongodb
  15. .. _`django-celery-with-mongodb`:
  16. http://pypi.python.org/pypi/django-celery-with-mongodb
  17. .. _broker-mongodb-configuration:
  18. Configuration
  19. =============
  20. Configuration is easy, set the transport, and configure the location of
  21. your MongoDB database::
  22. BROKER_URL = 'mongodb://localhost:27017/database_name'
  23. Where the URL is in the format of::
  24. mongodb://userid:password@hostname:port/database_name
  25. The host name will default to ``localhost`` and the port to 27017,
  26. and so they are optional. userid and password are also optional,
  27. but needed if your MongoDB server requires authentication.
  28. .. _mongodb-results-configuration:
  29. Results
  30. -------
  31. If you also want to store the state and return values of tasks in MongoDB,
  32. you should see :ref:`conf-mongodb-result-backend`.