Django - use custom template loader on a per-request basis?
问题 Is there a lower-level way to provide the list of loaders when rendering a template, as opposed to always having Django use the setting? I'd like to use a custom template loader instance for only a few views (I have my reasons). 回答1: It looks like you'll have to write some code of your own to do it. Let's take a look at the normal code path for loading templates, if you use, say, render_to_response , where the relevant part of the source is: return HttpResponse(loader.render_to_string(*args,