Skip to main content

Allows handle PostgreSQL notifies via listener as regular Django signal.

Project description

# Django PostgreSQL Signals

This django app allows you to pass events about database changes directly into Djano as regular signal.


# Install

## Pypi

```
pip install pgsignals
```

# Usage

**settings.py**
```
INSTALLED_APPS = [
"pgsignals",
...
]

PGSIGNALS_OBSERVABLE_MODELS = [
"myapp.ModelA",
"myapp.ModelB",
]
```

**apps.py**
```
from pgsignals.signals import pgsignals_event

class MyAppConf(AppConf):

def ready():
pgsignals_event.connect(on_pg_event)


def on_pg_event(*args, **kwargs):
event = kwargs['event']
model = kwargs['sender']
# Do some useful stuff here
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pgsignals-0.3.4-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page