Skip to main content

Simple django application to trigger hooked methods.

Project description

hooked-on-django

Version

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 details)

Uploaded Source

Built Distribution

hooked_on_django-0.2.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file hooked-on-django-0.2.0.tar.gz.

File metadata

  • Download URL: hooked-on-django-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for hooked-on-django-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8ab4ab1bd052e5810f8fed76eb7e241b980938ce3d8724b7fa10398bfe9a676e
MD5 2caf230b35cc3fb354a43b747501d0eb
BLAKE2b-256 d4cede630b013edb868d0312c804ce61ac2144246d373ce759c19337f7e8ab7e

See more details on using hashes here.

File details

Details for the file hooked_on_django-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hooked_on_django-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for hooked_on_django-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 084f75184bfcdd470c2f304207d1d1804513d8c55a6d4c5392c5a271f82927cb
MD5 3d5bd301e325b109dbdd1249d73c9f50
BLAKE2b-256 62153136b2f6cc84c792f307fe6d58f6cd919bea378d42ea9df1c981e3a206d3

See more details on using hashes here.

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