is func a function object defined in settings? Generally, it's not a good idea to import stuff in settings. How about defining the path to the function in the settings and then import it dynamically, similar to what we do with INDEX_BASE_CLASS