I have working flask routes to function handlers that correctly return html by extending another template and I want to call my own program from within one of these function handlers. Where should I put my program files in relation to the site directory for this to work on pythonanywhere and what is the correct way to call my program from within the function handler in the templates folder of the flask site directory (my program returns str) ?
{% extends "index.html" %}
{% block content %}
<div class="jumbo">
<p> {% print('baz') %} </p>
</div>
{% endblock %}
For instance, baz is rendered correctly but I can't get the string returned from myfunc() to do this. How do I call myfunc() so it gets into this block? Is there any way to do this??? Where should mymodule.py be in my directory , where should it be imported? in my routes.py file? That doesn't seem to work... I'm lost ! sigh ....