otherqueues.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. _tut-otherqueues:
  2. ==========================================================
  3. Using Celery with Redis/Database as the messaging queue.
  4. ==========================================================
  5. .. contents::
  6. :local:
  7. .. _otherqueues-installation:
  8. Installation
  9. ============
  10. .. _otherqueues-redis:
  11. Redis
  12. =====
  13. For the Redis support you have to install the Python redis client::
  14. $ pip install -U redis
  15. .. _otherqueues-redis-conf:
  16. Configuration
  17. -------------
  18. Configuration is easy, set the transport, and configure the location of
  19. your Redis database::
  20. BROKER_BACKEND = "redis"
  21. BROKER_HOST = "localhost" # Maps to redis host.
  22. BROKER_PORT = 6379 # Maps to redis port.
  23. BROKER_VHOST = "0" # Maps to database number.
  24. .. _otherqueues-database:
  25. Database
  26. ========
  27. .. _otherqueues-database-conf:
  28. Configuration
  29. -------------
  30. The database backend uses the Django ``DATABASE_*`` settings for database
  31. configuration values.
  32. #. Set your carrot backend::
  33. CARROT_BACKEND = "ghettoq.taproot.Database"
  34. #. Add :mod:`ghettoq` to ``INSTALLED_APPS``::
  35. INSTALLED_APPS = ("ghettoq", )
  36. #. Verify you database settings::
  37. DATABASE_ENGINE = "mysql"
  38. DATABASE_NAME = "mydb"
  39. DATABASE_USER = "myuser"
  40. DATABASE_PASSWORD = "secret"
  41. The above is just an example, if you haven't configured your database before
  42. you should read the Django database settings reference:
  43. http://docs.djangoproject.com/en/1.1/ref/settings/#database-engine
  44. #. Sync your database schema.
  45. When using Django::
  46. $ python manage.py syncdb