xcorat
xcorat

Reputation: 1472

Jinja2 template with extension .html on pyramid?

How can I use a jinja2 template with a .html extension in pyramid? For instance, I want the view configuration to look like,

@view_config(context=MyModel, renderer='templates/index.html')
def home_view(request):
...

Is it possible?

Upvotes: 3

Views: 1351

Answers (2)

merwok
merwok

Reputation: 6907

In recent versions:

config.add_jinja2_renderer(".html")

Upvotes: 0

Michael Merickel
Michael Merickel

Reputation: 23331

config.add_renderer('.html', 'pyramid_jinja2.renderer_factory')

Upvotes: 17

Related Questions