Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #20 -- Allow multiple DTL engines. #21

Merged
merged 1 commit into from Apr 3, 2016

Conversation

charettes
Copy link
Contributor

Multiple engines should be supported as long as they all use DTL.

@charettes
Copy link
Contributor Author

Is this missing anything to be merged?

@nedbat
Copy link
Owner

nedbat commented Mar 29, 2016

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?

@charettes
Copy link
Contributor Author

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.

@charettes
Copy link
Contributor Author

Added test for multiple template engines.

Multiple engines should be supported as long as they all use DTL.
@nedbat nedbat merged commit e9a4695 into nedbat:master Apr 3, 2016
@nedbat
Copy link
Owner

nedbat commented Apr 3, 2016

Thanks, this is version 1.3! :)

@nedbat
Copy link
Owner

nedbat commented Apr 3, 2016

(btw, I made some adjustments to the tests)

@charettes
Copy link
Contributor Author

Thanks Ned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants