flask.templating render_template_string Example Code

render_template_string is a Flask function from the flask.templating package. render_template is used to generate output from a string that is passed in rather than from a file in the templates folder.

Note that render_template_string is sometimes imported from the flask package instead of from flask.templating. It is the same function that is imported, but there are less characters to type when you leave off the .templating part.

render_template is another callable from the flask.templating package with code examples.

You should read up on these subjects along with these render_template_string examples:

Example 1 from Flask-User

Flask-User (PyPI information and project documentation) is a Flask extension that makes it easier to add custom user account management and authentication to the projects you are building. The extension supports persistent data storage through both relational databases and MongoDB. The project is provided as open source under the MIT license.

Flask-User / flask_user / tests / tst_app.py

Example 2 from Datadog Flask Example App

The Datadog Flask example app contains many examples of the Flask core functions available to a developer using the web framework.

Datadog Flask Example App / python/flask/app / blueprint.py