I\'m very new to jinja2 and the use of templates in general so I was wondering if there\'s an easy way to load an external javascript. I was thinking of using:
This question is quite old, but there is another way of doing it that might be interesting as well. I found it while working with Jinja2 and flask.
I used the url_for()
and it works fine:
{% block javascript %}
{% endblock %}
And I have my myscript.js
in my static folder. Specified in Jinja2 environment, or by default in flask.