jinja2
Python - 'ascii' codec can't decode byte
I\'m using Python 2.6 and Jinja2 to create HTML reports. I provide the template with many results and the template loops through them and creates HTML tables[详细]
2023-02-12 08:42 分类:问答Accessing global attributes from inside a macro in Jinja2
I\'ve been using macros in Jinja2 extensively and find them very DR开发者_运维百科Y-ish; but there is one thing bothering me: how to access global stuff from macros? It would be really neat if I could[详细]
2023-02-11 12:52 分类:问答I don't understand Jinja2 Call Blocks
I understand the concept, but I don\'t understand the syntax. I\'m going to use the example used on their site[详细]
2023-02-10 18:01 分类:问答Is there a way to change the Jinja2 template loading directory per-request?
Is there a way to change the Jinja2 root directory per-request on Flask? Right now I do: app.jinja_loader = FileSystemLoader(t开发者_StackOverflowemplate_directory)[详细]
2023-02-09 14:48 分类:问答CherryPy doesn't properly handle non-ASCII characters in Jinja2 templates
I am trying to run a website using Python 2.7.1, Jinja 2.5.2, and CherryPy 3.1.2. The Jinja templates I am using are UTF-8 encoded. I noticed that some of the characters in those templates are being t[详细]
2023-02-09 11:11 分类:问答Can a Jinja variable's scope extend beyond in an inner block?
I have the following Jinja template: {% set mybool = False %} {% for thing in things %} <div class=\'indent1\'>[详细]
2023-02-08 14:09 分类:问答Python: How can I implement this in a DRY way using Jinja2?
I have lots of code like this in my template: <h2>Owners of old cars</h2> <table id=\"hor-minimalist-b\" summary=\"Old Cars\">[详细]
2023-02-07 04:06 分类:问答Import a Python module into a Jinja template?
Is it possible to import a Python module into a Jinja template so I can use its functions? For example, I have a format.py file that contains methods for formatting dates and times. In a Jinja macro[详细]
2023-02-07 01:28 分类:问答Jinja2 templates using Django template tags
I\'m using Jinja2 on a new project, but would like to use the django-socialregistration app, which relies on Django template tags. Jinja2 doesn\'t play nicely with template tags, so I\'m wondering if[详细]
2023-02-06 13:43 分类:问答Where do you store the variables in jinja?
I\'ve got five pages with the same page layout and structure, but some different colors, text, etc, so this is an ideal environment for templating. I\'ve decided to use Jinja2 and probably flask. I\'v[详细]
2023-02-04 11:02 分类:问答