Closed charettes closed 8 years ago
Is this missing anything to be merged?
Sorry, my attention has mostly been elsewhere recently.
I don't have personal experience with multiple template engines. Right now, the code will refuse to work if you have two Django template backends, and one of them is not debug-enabled. Is that reasonable?
Can we add some tests for the multiple-engine case?
Sorry, my attention has mostly been elsewhere recently.
No worries!
I don't have personal experience with multiple template engines.
They are useful if you want to define different set of built-ins and/or context processors for specific use cases. For example, in a specific project I use the default
engine as usual and define a restricted
aliased engine to allow the rendering of some user provided templates.
Right now, the code will refuse to work if you have two Django template backends, and one of them is not debug-enabled.
Unsure how we should handle this case. IMHO we shouldn't crash if template debugging is turned off even if only one engine is configured. I think raising a RuntimeWarning
(using warnings.warn
) for each configured backend would be more appropriate but this is something that can be done in another commit/PR. Thoughts?
Can we add some tests for the multiple-engine case?
I'll add them right now.
Added test for multiple template engines.
Thanks, this is version 1.3! :)
(btw, I made some adjustments to the tests)
Thanks Ned!
Multiple engines should be supported as long as they all use DTL.