![]() |
Use Python on mustache template files - Printable Version +- (https://diviera.com) +-- Forum: Coding (https://diviera.com/forum-coding) +--- Forum: Python (https://diviera.com/forum-python) +--- Thread: Use Python on mustache template files (/thread-use-python-on-mustache-template-files) |
Use Python on mustache template files - Janusz - 12-17-2020 To use mustache templating language with Python we need chevron.
If you get some red errors try this:
If you still get red errors, sorry I'm a NOOB. Next, add chevron.exe to PATH, like pip message suggest. Example template file (diviera.txt):
Python code:
RE: Use Python on mustache template files - Janusz - 12-17-2020 Nested template fantastic solution. First render stuff that you need insde master template, add it to dictionary and render master template. Master template (diviera_master.txt): Use {{{content}}} (triple mustache) if you want use HTML as a content.Content template (diviera_content.txt):
Python code:
|