Question 21
Consider a flask app "app.py" and a template file "doc.html" given below:
Python file: app.py
from flask import Flask, render_template
app = Flask(__name__)
itemlist = [ {'value': '0', 'content': 'zero'}, {'value': '1', 'content': 'one'}, {'value': '2', 'content': 'two'}, {'value': '3', 'content': 'three'}, ]
@app.route('/')def func(): return render_template('doc.html', itemlist = itemlist)
app.run()Template file: doc.html
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"></head><body> {% macro render_field(value='field value', content='content value') %} <option value="{{value}}">{{content}}</option> {% endmacro %}
{% for item in itemlist %} {{ render_field(item.content) }} {% endfor %}</body></html>If the application is running locally on http://127.0.0.1:5000. What will be the raw HTML body of the file rendered by the flask app for base url?