Home > Enterprise >  Can I use hotwired turbo.js offline?
Can I use hotwired turbo.js offline?

Time:02-08

I'm trying to use turbo-flask in my python flask application. It tries to download turbo.js but failes because I'm not working with an internet connection. I thought about inserting the js file directly into my project but couldnt find it anywhere. Is it possible to use it offline?

CodePudding user response:

Short answer: YES.

You can install Turbo as instructed in Turbo Handbook
But that's without turbo-flask package, which uses CDN version as default.
But it seems like you can do (for example) this:

{{ turbo(url=url_for('static', filename='js/turbo.js')) }}

and then your app uses this downloaded js. That's if you just download current version of turbo js by hand. If you are using other ways (such as npm), then your file will be somewhere else and you need to edit code accordingly.

  •  Tags:  
  • Related