Skip to main content

Django tasks backend for Google Cloud Pub/Sub

Project description

django_tasks_pubsub

PostgreSQL-backed task pub/sub for Django.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_tasks_pubsub-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 eb6f05b1c69f9ce08e73d67d251c2037328c7670250a248ea0202f94a7c7ea64
MD5 b950984f7052f833304c01da16116e99
BLAKE2b-256 a6840bcbe4899ad77c553d7feca400ce91b2ac16723976e22998db783afbea72

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_tasks_pubsub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03f179d8278c011aa5cd4bd77a52cd75158c43005863c7f50a30d364a4a03ac0
MD5 cfc3be00d446e86bd1e6425588a7df29
BLAKE2b-256 77173d17f8050375ebc4622f6ba73e7782deddf4c0b7554c0d95bb3ab7aed20c

See more details on using hashes here.

Provenance

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