You can use render_template_string
:
>>> from flask import render_template_string
>>> render_template_string('hello {{ what }}', what="world")
'hello world'
More Related Contents:
- Link to Flask static files with url_for
- Passing HTML to template using Flask/Jinja2
- Reference template variable within Jinja expression
- Is it possible to use AngularJS with the Jinja2 template engine?
- Serve image stored in SQLAlchemy LargeBinary column
- Create dynamic arguments for url_for in Flask
- Display image stored as binary blob in template
- How to iterate through a list of dictionaries in Jinja template?
- Remove unnecessary whitespace from Jinja rendered template
- Reload Flask app when template file changes
- Serve static files from a CDN rather than Flask in production
- How to render by Vue instead of Jinja
- Jinja render text in HTML preserving line breaks
- How to generate an html directory list using Python
- Link to a specific location in a Flask template
- Converting Flask form data to JSON only gets first value
- How to use g.user global in flask
- ImportError: cannot import name ‘Markup’ from ‘jinja2’
- Returning rendered template with Flask-Restful shows HTML in browser
- Global variables in Flask templates
- How do I get the different parts of a Flask request’s url?
- Is it ever useful to use Python’s input over raw_input?
- Making an asynchronous task in Flask
- Send data from a textbox into Flask?
- Flask view shows 400 error instead of template with form
- Flask jsonify a list of objects
- What is the difference between isinstance(‘aaa’, basestring) and isinstance(‘aaa’, str)?
- How to accomplish relative import in python
- Flask broken pipe with requests
- Flask css not updating [closed]