Constant Django - Conservation Method

Can I call the django command after changing the constant value? I need to call:

python manage.py installtasks

for my kronos cron assignments. I do not know how to install it. In constant docs I found:

from constance.signals import config_updated

@receiver(config_updated)
def constance_updated(sender, key, old_value, new_value, **kwargs):
    print(sender, key, old_value, new_value)

but I don’t know what the receiver is (I get "NameError: the name" receiver "is not defined"), and where should I put this code. Any help?

+4
source share
1 answer

You can import the decorator,

from django.dispatch import receiver
+3
source

Source: https://habr.com/ru/post/1679558/


All Articles