djangopubsub-0.3.5
توضیحات
Base redis pubsub django wrapper
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | djangopubsub-0.3.5 |
| نام | djangopubsub |
| نسخه کتابخانه | 0.3.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Antonio @ KF |
| ایمیل نویسنده | antonio@kasfactory.net |
| آدرس صفحه اصلی | https://gitlab.com/kas-factory/packages/django-pubsub |
| آدرس اینترنتی | https://pypi.org/project/djangopubsub/ |
| مجوز | COPYRIGHT |
# Django pubsub
Django Pubsub wrapper.
## Installation with requirements.txt
```
djangopubsub
```
### With PIP
```bash
$ pip install djangopubsub
```
## Add app to django settings
```
INSTALLED_APPS = (
...,
'djangopubsub'
)
```
## Available settings and defaults:
```python
BASE_DIR = '' # Root directory for handlers lookup
EVENT_HANDLERS_DIR_NAME = 'event_handlers' # Directory with handlers on every app module
HANDLER_FILES_PREFIX = 'handlers_' # handlers file prefix
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
PUB_SUB_EMIT = True # Avoid to emit message when emit is called (for tests)
```
## Decorator
```python
@on_event('EVENT_NAME')
def func_to_execute(data):
pass
```
## Pubsub emit
```python
from djangopubsub.djangoPubSub import DjangoPubSub
DjangoPubSub().emit('EVENT_NAME', {})
```
## Pubsub receiver
Needs redis running on port:REDIS_PORT
```commandline
python manage.py runpubsubreceiver --settings=your_proyect.settings
```
نحوه نصب
نصب پکیج whl djangopubsub-0.3.5:
pip install djangopubsub-0.3.5.whl
نصب پکیج tar.gz djangopubsub-0.3.5:
pip install djangopubsub-0.3.5.tar.gz