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?
Asked
Active
Viewed 382 times
1 Answers
0
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="node_modules/@hotwired/turbo/dist/turbo.es2017-umd.js")) }}
and then your app uses this downloaded js.
This code is from my project, using npm
. If you don't you need to change the path accordingly.

janpeterka
- 568
- 4
- 17
-
turbo refer to cdn and this use in – Dimitri Kopriwa May 19 '23 at 12:38
-
I don't completely understand what you mean, @DimitriKopriwa. Can you explain in more detail please? – janpeterka May 19 '23 at 17:12
-
By that I mean do not take the module version using this method, use the umd version which doesn't require content within script tag elsewhere turbo navigation cannot be activated due to js content being dynamique with jinja – Dimitri Kopriwa May 20 '23 at 18:47
-
Ah, thanks! Yes, I posted original answer as general answer as it's described in turbo-flask docs. I updated it to use `umd`, pasted actual code I'm using in my project. – janpeterka May 22 '23 at 08:47