[Flask] folder structure and script-src-path

Nikolaus Neusser nik.gen at gmx.de
Sun Jul 24 15:47:23 EDT 2016


I changed the includes to "/static" and "/templates" (without "..").
I am going to use a local webserver to test my webpages and not open them directly in the browser (file://..)

Thanks for the hints,
Ben


Am 23.07.2016 um 15:54 schrieb linnchord:
> Run Flask buildin server on local like http://localhost:8000 <http://localhost:8080>, do not open html template 
> directly by file://...
>
> Nikolaus Neusser <nik.gen at gmx.de <mailto:nik.gen at gmx.de>>于2016年7月23日周六 下午7:15写道:
>
>     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.
>
>     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 <mailto:Flask at python.org>
>     https://mail.python.org/mailman/listinfo/flask
>
> -- 
> >> linnchord at gmail.com <mailto:linnchord at gmail.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160724/70e23262/attachment.html>


More information about the Flask mailing list