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

Specialised template loaders have no knowledge of the extension commonly associated with their engine #1259

Open
lenormf opened this issue Dec 8, 2020 · 1 comment

Comments

@lenormf
Copy link

lenormf commented Dec 8, 2020

Hi,

When using for example @mako_view("index"), the template engine will not pick up index.mako.

This happens because the BaseTemplate class has a hardcoded list of extensions that its specialisations don't modify accordingly to the extension that is commonly associated with them.

I'm currently working around that issue with the following:

bottle.BaseTemplate.extensions.append("mako")

I think a better way would be for the MakoTemplate, CheetahTemplate and Jinja2Template to pass to their parent class an additional extension upon instantiation. Consequently, the stpl extension should not be kept as a default extension in BaseTemplate, but passed by the SimpleTemplate class.

I can do a PR if you want me to!

HTH.

@lenormf
Copy link
Author

lenormf commented Jan 13, 2021

Ping

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

No branches or pull requests

1 participant