[Flask] folder structure and script-src-path

David Nieder davidnieder at gmx.de
Sat Jul 23 07:44:59 EDT 2016


On 23.07.2016 12:50, Nikolaus Neusser wrote:
> Hi everyone,
>
> i am having troubles in organizing my files in sub-folders and adding them to my html files.
> I am serving 4 static html files with custom .css and .js files.
> What is important to me, is that i can open the html files locally with my webbrowser without the server as well.

If those files are static html and not templates, just put them in your 
static folder ;)

>
> folder structure:
>    static\css -> custom.css
>    static\js   -> custom.js, jquery.js, ..
>    templates  -> 4x html files
>
>
> index.html:
>    If i deliver the file via the webserver i need the following code in index.html.
>    <script type="text/javascript" src="/static/js/jquery-2.2.3.js"></script>
>
>    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/"
>
> Thanks,
> Ben
>
>
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>



More information about the Flask mailing list