Django Kafka Event Log
Create an event from Django ORM object model, store the event into the database and also publish it into Kafka cluster.
Quick start
Install the package:
pip install django-kafka-event-log
In your project’s settings.py, include the app and add credentials for Kafka:
INSTALLED_APPS = [ ... 'events', ] KAFKA_GROUP = 'KAFKA_GROUP' KAFKA_BOOTSTRAP_SERVERS = 'KAFKA_BOOTSTRAP_SERVERS' KAFKA_SECURITY_PROTOCOL = 'KAFKA_SECURITY_PROTOCOL' KAFKA_SASL_MECHANISMS = 'KAFKA_SASL_MECHANISMS' KAFKA_SASL_USERNAME = 'KAFKA_SASL_USERNAME' KAFKA_SASL_PASSWORD = 'KAFKA_SASL_PASSWORD'Note: the credential should be read from environment variables.
This application has only 1 interface; it is PublishKafkaEventUtil. Given myapp is where the model object locates, MyModelSerializer is the data presenter, we can call the Util like this:
from events.utils import PublishKafkaEventUtil from myapp.serializers.mymodel_serializer import MyModelSerializer PublishKafkaEventUtil.call( event_name='Created', model_object=model_obj, serializer=ModelSerializer, metadata={'purpose': 'testing'}, )
Metadata
Release files for django-kafka-event-log 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-kafka-event-log-0.1.6.tar.gz | 9.6 kB | Without provenance | Details for django-kafka-event-log-0.1.6.tar.gz |
Release files / django-kafka-event-log-0.1.6.tar.gz
| Download URL | django-kafka-event-log-0.1.6.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed7eb601e4446430ec178ff7be9820aeff37107c6f2552f93a4d9ebee8c836c9
|
|
BLAKE2b-256 checksum How to use checksums |
62c8713c9ba9448eda6ba0e45f1ada93fd8a5e7a96c37e27a43d93d1c6cf59af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Security for django-kafka-event-log 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.