while some of these answers work for single small settings, my situation is a bit different. I develop a larger server app, with flask pages and dash pages, moreover I am abroad and have only very limited internet resources, so I would like to develop the flask/dash app without internet connection.
I serve my css, and js files via a /static/ Flask route, which works when I set both of the next two lines to ‘False’
However, my Flask pages need also jQuery which I would like to server also via the static route.
If both set to “False” my static rout provides the relevant css and js files, all is well, but the React components needed to render dash pages are not loaded (no inet connection). If I set the lines to “True” and “False” as shown above, Flask is unhappy (as the locally stored jQuery et all. are not loaded) but the dash pages have the react scripts…
Any idea how to solve my offline problem?
In the end the server runs with an internet connection, but for development without internet the situation is rather daring. (When the React components are being tried to load from the iNet, the server start is rather long winded, as there are many timeouts to wait for, this makes offline development essentially not possible)
Help and ideas welcome!
PS: Maybe the app.head functionality can help? I have not investigated that yet. See allow optional headers: