I kind of like the idea of encapsulating these sf_ prefixed functions into a class. Then you could just pass in the relevant portions of the settings dict, instead of tying it to Django unnecessarily.