[Flask] folder structure and script-src-path

Andrea D'Amore and.damore at gmail.com
Sat Jul 23 08:27:33 EDT 2016


On 23 July 2016 at 12:50, Nikolaus Neusser <nik.gen at gmx.de> wrote:

>   If i open index.html locally with my webbrowser i need the following code.
>   script type="text/javascript" src="../static/js/jquery-2.2.3.js"></script>
>
> The difference is "/static/" vs. "../static/"

If "locally" means the URL has by file:// protocol then it's the
correct behavior.

Locally should mean that you're running a local webserver (like
flask's builtin) and the URL for resources should indeed start with
the webserver root, e.g "/static/js/jquery…" .
If the latter is the case then provide a minimal example of your
layout that reproduces the issue and someone will find the reason.


-- 
Andrea


More information about the Flask mailing list