mongodb.rst 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. the ``celery[mongodb]`` :ref:`bundle <bundles>`:
  11. .. code-block:: bash
  12. $ pip install -U celery[mongodb]
  13. .. _broker-mongodb-configuration:
  14. Configuration
  15. =============
  16. Configuration is easy, set the transport, and configure the location of
  17. your MongoDB database::
  18. BROKER_URL = 'mongodb://localhost:27017/database_name'
  19. Where the URL is in the format of::
  20. mongodb://userid:password@hostname:port/database_name
  21. The host name will default to ``localhost`` and the port to 27017,
  22. and so they are optional. userid and password are also optional,
  23. but needed if your MongoDB server requires authentication.
  24. .. _mongodb-results-configuration:
  25. Results
  26. -------
  27. If you also want to store the state and return values of tasks in MongoDB,
  28. you should see :ref:`conf-mongodb-result-backend`.