Skip to main content

Django tasks backend for Google Cloud Pub/Sub

Project description

django_tasks_pubsub

Google Cloud Pub/Sub backend for Django tasks

Installation

pip install django_tasks_pubsub
INSTALLED_APPS = [
    ...
    "django_tasks_pubsub",
]

Settings

PUBSUB_PROJECT_ID = "your-google-cloud-project-id"
PUBSUB_DEFAULT_TOPIC_ID = "your-default-topic-id"

TASKS = {
    "default": {
        "BACKEND": "django_tasks_pubsub.PubSubBackend",
    }
}

Usage

Configure Django task functions

from django.tasks import task

@task
def send_email(user_id):
    print(f"Sending email to {user_id}")

Configure specifics for the task

Specify a topic

Here we configure a task that publishes to the topic "resize_images"

from django.tasks import task
from django_tasks_pubsub import pubsub_task

@task
@pubsub_task(topic="resize_images")
def function(image_id):
    ...

Development

License

MIT

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_tasks_pubsub-0.1.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tasks_pubsub-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file django_tasks_pubsub-0.1.3.tar.gz.

File metadata

  • Download URL: django_tasks_pubsub-0.1.3.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_tasks_pubsub-0.1.3.tar.gz
Algorithm Hash digest
SHA256 22e1cabceee92d0cb95817b0672c333b3e5d970526b44f5bf399dc20a2489a64
MD5 7b2bdaa528e3c79e8ddff55ca0e47059
BLAKE2b-256 a644827a872c5c40746c71088423775520ef5731f46428d4f7f4077531950a93

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_pubsub-0.1.3.tar.gz:

Publisher: create_tag_and_release.yml on joelbitar/django_tasks_pubsub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_tasks_pubsub-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tasks_pubsub-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c00225a6be9f7daf221b44cbed3f3966dfc9357e6e15230a8cf3c907020b994f
MD5 e47343e21aca1caafc1b6ffe414476ab
BLAKE2b-256 00bbd1fe549e2033074b7f55b1587de3945c74635ac104acfca3a8fcd077adf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_pubsub-0.1.3-py3-none-any.whl:

Publisher: create_tag_and_release.yml on joelbitar/django_tasks_pubsub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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