I am developing an application using the very convenient Flask system, and I used the jinja template to write a lot of links that correspond to pages in Flask, which are defined as follows:
@app.route(/<var1>/<var2>) ... ...
on the test server, these links work very well, however, when I switch from the test server to the server behind the proxy server, I get a problem when the href links do not take into account the extra directory name inserted by my proxy.
#where a link should read: server:/myapp/<var1>/<var2> # it acually puts out: server:/<var1>/<var2>
my jinja etemplate looks like this, but I wonder if, instead of putting a backslash, there is a way to put a variable that indicates the root directory.
{% block navigation %} {% for record in db.values() %} <li><a href="/{{db.name}}/{{record.name}}">{{record.name}}</a></li> {% endfor %} {% endblock %}
Any help would be greatly appreciated. Thanks to the Flask team!
source share