The beta byte pattern function in the python of the bottle does not display the pattern as it should

I am trying to reproduce the basic example of the rebase function from the documentation for the bottle, but when my template renders, the html code is encoded and my tags are replaced with the corresponding html code.

My template:

% rebase('base.tpl', title='Page Title')
<p>Page Content ...</p>

My base template:

<html>
<head>
  <title>{{title or 'No title'}}</title>
</head>
<body>
  {{base}}
</body>
</html>

Final html rendering:

<html>
<head>
  <title>Page Title</title>
</head>
<body>
      &lt;p&gt;Page Content ...&lt;/p&gt;

</body>
</html>

As you can see, my template is included in the right place, but he likes it if the template engine escaped it for security reasons, and I don't know why.

I am surprised that I have only one problem.

I use bottle v0.12.5 and reproduced the problem on different environments (MacOSX and Ubuntu)

Any thoughts or ideas? Thanks

+4
source share
1 answer

HTML . , ! :

<body>
  {{!base}}
</body>

.

+5

Source: https://habr.com/ru/post/1535270/


All Articles