I wouldn't want to do it at the module level, because that would definitely introduce possible ordering issues. I was thinking that the `@lazy` method would be on the middleware itself, which means that it would be happening after django settings have already been loaded. (You could also just compile the regexes in `__init__`, so you wouldn't need `@lazy` at all).

The concern I have there is whether the middleware gets instantiated per-request. I don't think it does, but I'd have to go poke around the source to be sure.