No project description provided
Project description
DJ StreamIO
Framework for making it easy to post stream updates to (stream.io)[https://getstream.io]
Installation
pip install dj-streamio
Configuration
1. Add streamio
to INSTALLED_APPS
2. Configure your models for tracking:
e.g.:
class Todo(models.Model, StreamModelMixin):
collection = 'todos'
feed_name = 'todo'
feed_actor_field = 'owner_id'
feed_once_off_actions = ["create"]
feed_related_mapping = [
# feed_slug, model_field
('user', 'owner_id'),
('todo', 'id'),
]
enrichment_serializer = 'example_app.models.TodoSerializer'
Notes:
- We add
StreamModelMixin
to our model - Add the various meta fields
- Profit
now you can now run:
todo = Todo.objects.first()
todo.track_action('create')
todo.track_action('start')
todo.track_action('complete')
TODOS:
- Provide signals
- Provide async celery task
- Provide alternative backends (later)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dj-streamio-0.0.1.tar.gz
(3.4 kB
view hashes)