Viviane
Viviane

Reputation: 177

How to use flask render_template inside a MoinMoin macro?

I'm new to MoinMoin and flask. I have a moinmoin site using python macros. For the moment, I just use some basic string format method to return html from my macro. I would like to use the flask templates with the render_template method. It doesn't work for now, because the context stack seems to be empty. I don't really know what is the good way of making it work. Should i create a context with flask by giving to it the macro object itself or the macro request ?

Upvotes: 1

Views: 274

Answers (1)

Sean Vieira
Sean Vieira

Reputation: 160033

When you are using a macro you are most likely using a Jinja2 macro (Python doesn't have macros). In that case you can use the include or import directives to load other Jinja templates and render them.

Upvotes: 0

Related Questions