README.rst 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ==============================================================
  2. Example Django project using Celery
  3. ==============================================================
  4. Contents
  5. ========
  6. ``proj/``
  7. ---------
  8. This is the project iself, created using
  9. ``django-admin.py startproject proj``, and then the settings module
  10. (``proj/settings.py``) was modified to add ``tasks`` and ``demoapp`` to
  11. ``INSTALLED_APPS``
  12. ``tasks/``
  13. ----------
  14. This app contains the Celery application instance for this project,
  15. we take configuration from Django settings and use ``autodiscover_tasks`` to
  16. find task modules inside all packages listed in ``INSTALLED_APPS``.
  17. ``demoapp/``
  18. ------------
  19. Example generic app. This is decoupled from the rest of the project by using
  20. the ``@shared_task`` decorator. Shared tasks are shared between all Celery
  21. instances.
  22. Starting the worker
  23. ===================
  24. The ``DJANGO_SETTINGS_MODULE`` environment must be set when starting the
  25. worker:
  26. .. code-block:: bash
  27. $ DJANGO_SETTINGS_MODULE='proj.settings' celery -A tasks worker -l info