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:
I think you are putting the file main.js in the wrong location.
main.js
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.
template/js/main.js