Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chris104957/django-carrot
A lightweight task queue for Django using RabbitMQ
https://github.com/chris104957/django-carrot
asynchronous-tasks django django-carrot pika python3 rabbitmq task-queue
Last synced: 5 days ago
JSON representation
A lightweight task queue for Django using RabbitMQ
- Host: GitHub
- URL: https://github.com/chris104957/django-carrot
- Owner: chris104957
- License: apache-2.0
- Created: 2017-10-12T11:21:09.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:39:51.000Z (about 2 years ago)
- Last Synced: 2024-05-22T18:23:06.060Z (7 months ago)
- Topics: asynchronous-tasks, django, django-carrot, pika, python3, rabbitmq, task-queue
- Language: Python
- Homepage: https://django-carrot.readthedocs.io/
- Size: 1.96 MB
- Stars: 71
- Watchers: 6
- Forks: 15
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://coveralls.io/repos/github/chris104957/django-carrot/badge.svg?branch=master
:target: https://coveralls.io/github/chris104957/django-carrot?branch=master.. image:: https://readthedocs.org/projects/django-carrot/badge/?version=latest
:target: http://django-carrot.readthedocs.io/en/latest/?badge=.. image:: https://travis-ci.org/chris104957/django-carrot.svg?branch=master
:target: https://travis-ci.org/chris104957/django-carrot.svg?branch=master.. image:: https://coveralls.io/repos/github/chris104957/django-carrot/badge.svg?branch=master
:target: https://coveralls.io/github/chris104957/django-carrot?branch=master).. image:: https://badge.fury.io/py/django-carrot.svg
:target: https://badge.fury.io/py/django-carrot.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
:target: https://opensource.org/licenses/Apache-2.0.. image:: /docs/source/images/carrot-logo-big.png
:align: center**django-carrot** is a lightweight task queue backend for Django projects that uses the RabbitMQ message broker, with
an emphasis on quick and easy configuration and task trackingInstallation
------------Install django-carrot:
.. code-block:: bash
pip install django-carrot
Install and run RabbitMQ
.. code-block:: bash
brew install rabbitmq
brew services start rabbitmqConfiguration
-------------1. Add carrot to your Django project's settings module:
.. code-block:: python
INSTALLED_APPS = [
...
'carrot',
...
]2. Apply the carrot migrations to your project's database:
.. code-block:: python
python manage.py migrate carrot
Usage
-----To start the service:
.. code-block:: bash
python manage.py carrot_daemon start
To run tasks asynchronously:
.. code-block:: python
from carrot.utilities import publish_message
def my_task(**kwargs):
return 'hello world'publish_message(my_task, hello=True)
To schedule tasks to run at a given interval
.. code-block:: python
from carrot.utilities import create_scheduled_task
create_scheduled_task(my_task, {'seconds': 5}, hello=True)
.. note::
The above commands must be made from within the Django environmentDocker
------A sample docker config is available `here `_
Full documentation
------------------The full documentation is available `here `_
Support
-------If you are having any issues, please `log an issue `_
Contributing
------------Django-carrot uses `Packagr `_ to share development builds. If you'd like access to it,
please send me your email address at [email protected] so I can give you accessLicense
-------The project is licensed under the Apache license.
Icons made by Trinh Ho from `www.flaticon.com `_ is licensed by CC 3.0 BY