Simple django application to trigger hooked methods.
Project description
hooked-on-django
startup hook
All methods listed under this hook will be executed after Django finishes its startup process.
settings.py
INSTALLED_APPS = [
...,
"hooks.startup",
...,
]
DJANGO_HOOKS = {
"STARTUP": {
"path.to.method": {
"delay": 0,
"args" : [
...
],
"kwargs": {
...
},
}
}
}
examples
file: /path/to.py
def method(param1: str, param2: int):
...
def other(param1: str = "", param2: int = 0):
...
def another():
...
To add a hook to each of these methods, the following configuration can be used:
DJANGO_HOOKS = {
"STARTUP": {
"path.to.method": {
"delay": 10,
"args": ["string", 123456]
},
"path.to.other": {
"kwargs": {
"param1": "string",
"param2": 123456
}
},
"path.to.other": {}, # No params needed.
}
}
note: additionaly, the method method
will be executed after a 10 seconds delay.
🎣️
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
hooked-on-django-0.2.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for hooked_on_django-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 084f75184bfcdd470c2f304207d1d1804513d8c55a6d4c5392c5a271f82927cb |
|
MD5 | 3d5bd301e325b109dbdd1249d73c9f50 |
|
BLAKE2b-256 | 62153136b2f6cc84c792f307fe6d58f6cd919bea378d42ea9df1c981e3a206d3 |