0

I have a model that is firing a post_save signal in the django framework set to run more than one site. What I need to do is to be able to override that signal with a signal that will be defined in the specific site that needs this signal and use the one in the main app as a base.

Or maybe in short I want to be able to write these signals or any other code that is specific to each site in its own place but inheriting from the common code.

ucMedia
  • 4,105
  • 4
  • 38
  • 46

1 Answers1

0

You should be able to do this by importing only the signals you need to use. You could have a separate set of signal files for each of your sites, importing them relatively to your wsgi.py or manage.py files, which should allow you to override or extend your entire base signal library.

If all of your sites are running from one wsgi.py or manage.py file, you will probably have to test which files to import instead of relying on importing them relative to your cwd.