A django app to allow dynamic control of signals
Project description
django-signalcontrol
A django extension for dynamically enabling/disabling signals. This application allows django signals to be disabled or enabled on-demand through the django admin interface.
Author | David Slusser |
Description | A django extension for dynamically enabling/disabling signals. |
Requirements | Python 3.x Django 2.2.x |
Documentation
Full documentation can be found on http://django-signalcontrol.readthedocs.org. Documentation source files are available in the docs folder.
Installation
- pip install django-signalcontrol
- add signalcontrol to your INSTALLED_APPS
- run migrations python ./manage.py migrate signalcontrol
Features
signal decorator
SignalControl can be added to a signal with the provided decorator. In the signals.py file, import the signalcontrol decorator and add the signal_control decorator to the line directly above the signal definition. Example:
admin interface
An django admin interface for django-signalcontrol is available to set signals to enabled or disabled. This displays all signals that can be controlled, and lists the application, model, signal receiver and signal name. Additionally, full search is available and filters are available for each field. Signals can be enabled or disabled individually or in bulk.
Usage Example
from signalcontrol.decorators import signal_control
@receiver(post_save, sender=MyCoolModel)
@signal_control
def msg_after_my_model_save(sender, instance, created, **kwargs):
""" some signal """
print("you just saved an instance of MyCoolModel")
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
Built Distribution
Hashes for django-signalcontrol-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd31b9221560fe6ccac0943175b821194c37cb0108ef1f9d0e96e4e3339200e |
|
MD5 | f28813ef911f47e9f91c85d64c033d6b |
|
BLAKE2b-256 | 4661e396cb4b8072dadb4b98e1aa18aae043d76c119d4d88ce7e6af31b7bf563 |
Hashes for django_signalcontrol-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 850d12a7bbc26c8815433b203742ee1120b5f355bbb643db097c59f275dde5dd |
|
MD5 | 864f44416a824e364f4098f7ee3847a3 |
|
BLAKE2b-256 | 3b0a1f3547d16a0f420d50cc68dcb04a13a5ce3aaf0e6afc2f6998d3d3077aeb |