Giter Club home page Giter Club logo

django-carrot's Introduction

https://coveralls.io/repos/github/chris104957/django-carrot/badge.svg?branch=master https://readthedocs.org/projects/django-carrot/badge/?version=latest https://travis-ci.org/chris104957/django-carrot.svg?branch=master https://coveralls.io/repos/github/chris104957/django-carrot/badge.svg?branch=master

/docs/source/images/carrot-logo-big.png

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 tracking

Installation

Install django-carrot:

pip install django-carrot

Install and run RabbitMQ

brew install rabbitmq
brew services start rabbitmq

Configuration

  1. Add carrot to your Django project's settings module:
INSTALLED_APPS = [
    ...
    'carrot',
    ...
]
  1. Apply the carrot migrations to your project's database:
python manage.py migrate carrot

Usage

To start the service:

python manage.py carrot_daemon start

To run tasks asynchronously:

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

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 environment

Docker

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 access

License

The project is licensed under the Apache license.

Icons made by Trinh Ho from www.flaticon.com is licensed by CC 3.0 BY

django-carrot's People

Contributors

chris104957 avatar ewsterrenburg avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.