Skip to main content

A Bitcaster integration with Django

Project description

bitcaster-django

Bitcaster-django is a Django app for seamless integrating with Bitcaster system-to-user signal-to-message notification system.

Dependencies

  • Python 3.8 or later
  • Django 4.2 or later

Installation

  • Install bitcaster-django using your package manager of choice, e.g. Pip:

    pip install bitcaster-django
    # or, with django-constance support for runtime configuration:
    pip install bitcaster-django[constance]
    
  • Add bitcaster-django to INSTALLED_APPS in your config/settings.py file:

    INSTALLED_APPS = (
        ...
        "bitcaster_django",
        ...
    )
    
  • Configure the app with the BITCASTER dictionary in your config/settings.py file:

    BITCASTER = {
        # Bitcaster Application Endpoint.
        # Falls back to the BITCASTER_BAE environment variable when empty/omitted.
        "BAE": "https://<token>@<host>/api/o/<organization>/",
        # forwarded to bitcaster_sdk.init() (optional, default: False)
        "DEBUG": False,
        # keep Bitcaster users aligned with Django users (optional, default: True)
        "SYNC_USERS": True,
        # project/application slugs used by Client.trigger_event() (optional)
        "PROJECT": "myprj",
        "APPLICATION": "myapp",
    }
    

    The bitcaster_sdk client is initialized automatically at startup: no bitcaster_sdk.init() call is needed in your code.

  • Check that your configuration is valid:

    python manage.py check
    

User synchronisation

When SYNC_USERS is enabled (the default), a post_save handler on your AUTH_USER_MODEL keeps Bitcaster users aligned with Django users:

  • creating a Django user creates the matching Bitcaster user;
  • updating a Django user updates it (creating it if missing).

Users without an email address are skipped, and any error while talking to Bitcaster is logged but never breaks the saving of the Django user.

Runtime configuration with django-constance (optional)

With the constance extra installed, any BITCASTER key can be overridden at runtime by declaring a BITCASTER_<KEY> entry in CONSTANCE_CONFIG:

INSTALLED_APPS = [
    ...
    "constance",
    "bitcaster_django",
]

CONSTANCE_CONFIG = {
    "BITCASTER_BAE": ("", "Bitcaster Application Endpoint"),
}

A non-empty constance value takes precedence over the BITCASTER dictionary, and the sdk client is reinitialized automatically whenever a BITCASTER_* constance key is updated.

Bug reports and requests for enhancements

Please open an issue on the project's issue tracker on GitHub.

Contributing to the project

See the contribution guide.

Licensing

All rights reserved.

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

bitcaster_django-0.4.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

bitcaster_django-0.4.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file bitcaster_django-0.4.1.tar.gz.

File metadata

  • Download URL: bitcaster_django-0.4.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bitcaster_django-0.4.1.tar.gz
Algorithm Hash digest
SHA256 1f5deddeb36f1295d267eca8751a97c7f54693932fd1d9b7ffd3493643911a10
MD5 94e9c5b046c852f094a53b1f4f5caa98
BLAKE2b-256 6f6e8fcb9e434512be57b09382545eaf273c799db1ed4a5b4b48a99f0ecffeda

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitcaster_django-0.4.1.tar.gz:

Publisher: release.yml on k-tech-italy/bitcaster-django

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

File details

Details for the file bitcaster_django-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bitcaster_django-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20d93a460a7b9dcce203a96ce3cfb3fae2b8b3b29a8ff0345bb8178c17c881f6
MD5 227171737bfab40bc9c320549d946879
BLAKE2b-256 44890b7629978819b7e33b35c0484f187ba9c6bf91321c7f95c1f2d46f361a5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitcaster_django-0.4.1-py3-none-any.whl:

Publisher: release.yml on k-tech-italy/bitcaster-django

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