I have just recently started playing around with Flask and have no previous html/php experience, so please forgive me if this is naive!
I'm trying to use some php within an html file to improve a webapp I've built, but cannot even get the simplest test case to work. For example, take a test case from this site:
--test_app.py--
import flask
app = flask.Flask('flask_test')
@app.route('/')
def test():
return flask.render_template('test.html')
if __name__ == '__main__':
app.run()
--templates/test.html--
<html>
<head></head>
<body>
<ul>
<?php for($i=1;$i<=5;$i++){ ?>
<li>Menu Item <?php echo $i; ?></li>
<?php } ?>
</ul>
</body>
</html>
--expected output--
Menu Item 1
Menu Item 2
Menu Item 3
Menu Item 4
Menu Item 5
--actual output--
Menu Item
If there an inherent incompatibility with Flask? Am I forgetting to include something (either on the python/flask side or the html/php side) that will make it all work together?
Thanks!