Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bearbobs/stream-data
Data Streaming application using Django Channels
https://github.com/bearbobs/stream-data
Last synced: 1 day ago
JSON representation
Data Streaming application using Django Channels
- Host: GitHub
- URL: https://github.com/bearbobs/stream-data
- Owner: Bearbobs
- Created: 2020-03-21T11:31:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:51:12.000Z (almost 2 years ago)
- Last Synced: 2023-03-03T00:19:04.569Z (over 1 year ago)
- Language: Python
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stream-data
Data Streaming application using Django Channels
It provides API endpoints for your Django application that can push data to connected clients. Data is sent using the Server-Sent Events protocol (SSE), in which data is streamed over a never-ending HTTP response.For example, endpoint, `/events/`, that a client could connect to with a GET request:
```http
GET /events/ HTTP/1.1
Host: api.example.com
Accept: text/event-stream
```The client would receive a streaming HTTP response with content looking like this:
```http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Connection: Transfer-Encoding
Content-Type: text/event-streamevent: message
data: {"foo": "bar"}event: message
data: {"bar": "baz"}...
```## Features:
* Easy to consume from browsers or native applications.
* Highly reliable. Events can be persisted to your database, so clients can recover if they get disconnected.
* Set per-user channel permissions.## How to Setup:
python3 is assumed to be installed, if not do the same
```
virtualenv venv
pip install -r requirements.txt
python manage.py migrate
python manage.py makemigrations
python manage.py runserver
```
for Authorization: channelmanager in stream app
for Generating data: generators.py### for Scaling and Large UserBase:
you need to run multiple instances of your Django project for high availability, or need to push data from management commands, or need to be able to scale to a large number of connections, you can introduce a GRIP proxy layer (such as [Pushpin](https://pushpin.org) or [Fanout Cloud](https://fanout.io)) into your architecture.