Skip to main content

A small Django DRF extension for managing background task with celery

Project description

django-task

django-task is a library designed to assist you in tracking Celery tasks within your Django project. It provides a seamless integration with your current database and offers RESTful APIs for managing and monitoring your tasks.

Features

  • Task Tracking: With django-task, you can easily track the status, progress, and result of your Celery tasks. The library stores this information in your database, allowing you to retrieve and analyze task data at any time.

  • RESTful APIs: django-task exposes a set of RESTful APIs that enable you to interact with your Celery tasks programmatically. You can create, update, delete, and retrieve tasks using these APIs, providing flexibility in managing your task workflow.

  • Integration with Celery: This library seamlessly integrates with Celery, a widely-used distributed task queue framework. You can use all the powerful features of Celery, such as task scheduling, distributed processing, and task retries, while leveraging django-task for task tracking and management.

Installation

You can install django-task using pip:

pip install django-task

Make sure you have Celery and Django installed as well.

Usage

Once installed and configured, you can start tracking your Celery tasks using django-task. Here's a basic example of how to use the library:

from django_task.models import Task
from django_task.serializers import TaskSerializer

# Create a new task
task = Task.objects.create(name='my_task', status='PENDING', progress=0)

# Update task status and progress
task.status = 'STARTED'
task.progress = 50
task.save()

# Retrieve task information
serialized_task = TaskSerializer(task)
print(serialized_task.data)

This example demonstrates creating a new task, updating its status and progress, and retrieving the task information using the provided serializer.

For detailed usage instructions and available APIs, please refer to the documentation.

Contributing

Contributions to django-task are welcome! If you encounter any issues, have suggestions, or would like to contribute new features, please feel free to open an issue or submit a pull request on the GitHub repository.

When contributing, please ensure that you follow the existing coding style, write tests for new functionality, and update the documentation accordingly.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_bg_task-0.0.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

django_bg_task-0.0.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file django_bg_task-0.0.0.tar.gz.

File metadata

  • Download URL: django_bg_task-0.0.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for django_bg_task-0.0.0.tar.gz
Algorithm Hash digest
SHA256 0ad58eb84224687ba844abe5e0b176b17466ef441f54f974b8fd32883a47d871
MD5 1a848e1f716644124f3f808c44b4eb6d
BLAKE2b-256 5f264a38181e83747a22f7153f5b2d21f6b487ede6bb7fc6a8673dcf8b600c1f

See more details on using hashes here.

File details

Details for the file django_bg_task-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_bg_task-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b259098e08ead08d28697416de2349e03fc4a61477f74770ce445505325a689
MD5 55f3e55e44872abef3c9a38022888a33
BLAKE2b-256 419e026e29f832e31a5734b63b8c4c62e44e96433cab05c776597cd611aaf384

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page