Solution
>>> from flask import Flask, render_template_string
>>> app = Flask(__name__)
>>> with app.app_context():
>>> render_template_string('I love {{fruit}}', fruit='apple')
'I love apple'
>>> from flask import Flask, render_template_string
>>> app = Flask(__name__)
>>> with app.app_context():
>>> render_template_string('I love {{fruit}}', fruit='apple')
'I love apple'