A Django app to store an event and publish the event to Kafka
Project description
Store an event and publish the event to Kafka
Quick start
Install package:
pip install django-kafka-event-log
Add “events” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'events', ]
Set up Kafka credential in “settings.py” like this:
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'
Store and send event:
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'}, )
Author: Diag
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
Close
Hashes for django-kafka-event-log-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6338368a935fd1f7a8fdd47fdce7270ba8b0fdf30939ffd4336857fb41698a24 |
|
MD5 | 85236b3876b325977dc921fc8fa8cf27 |
|
BLAKE2b-256 | 526e02d87221d1623777d70dfca24ff4ca6b6b1c3ed7a68dc3042b36e00a3890 |