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.4.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.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_tasks_pubsub-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1494c3c26fdc9c91a7fd5c452a8296039677d97f5959f7f9540e27a17f771be0
MD5 3c358512dee4dc18383235b6d094bb8c
BLAKE2b-256 727de787673884f442c2e0ed1b7908097d1c4985bec9712b43760826b625897f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_pubsub-0.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tasks_pubsub-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2cd1eeabc523f54619a2a3630e246599f0284535d782cf36c55ccf1ba19b8ace
MD5 4a927d1f87e81e60d27bee9e70a11ffe
BLAKE2b-256 f7b886e575ad6eeb546c576957995a5c5cbf5a558c0f97af0ec1767182995547

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tasks_pubsub-0.1.4-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