How to load a javascript or css file into a BottlePy template?

后端 未结 3 1546
悲哀的现实
悲哀的现实 2020-12-08 03:35

I am trying to return a html template with BottlePy. And this works fine. But if I insert a javascript file like this in my tpl-file:



        
3条回答
  •  庸人自扰
    2020-12-08 04:05

    I think you are putting the file main.js in the wrong location.

    Note that this file path must be relative to the requested url, not relative to the path to your template. So putting it in a folder like template/js/main.js will not work.

提交回复
热议问题