django-rules: where to put the rules/predicates?

611 views Asked by At

Stupid question but when using django-rules for usage in RulesModel, where to I put my custom predicates? Do I create a separate rules file and import it into models.py?

1

There are 1 answers

0
Anton Pomieshchenko On BEST ANSWER

From docs https://github.com/dfunckt/django-rules/blob/master/README.rst#custom-rule-sets. You can create rules.py files in your applications and auto load them

INSTALLED_APPS = (
    # replace 'rules' with:
    'rules.apps.AutodiscoverRulesConfig',
)