Hi, I’m using Python and I know very little about web deployment, so I’m using some nano-examples with flask.
Can I save to disk an image generated by my script/app, say a PNG or a SVG, and load it from a static HTLM page? Where should I save it? What would that path be on the HTML?
I have tried saving to root
<img = src="image.svg"> produces a 404 error.
I have seen a thread that mentions that assets is a virtual folder you can’t save into it, and I stopped there.
Yes you can just save it in the apps’ disk space (the
There is no way, however, to save to the assets CDN via code at the moment.
You can vote for this here:
Thanks for engaging with this question @EddiesTech!
Could you please be even more basic and show me a Python save and a HTML load path? I tried
<img src="app/image.svg"> without sucess.
Does the image file show up in the editor? If not, does it come up when you do the command
ls in the terminal
When loading images, you should pretend that the app folder does not exist.
<img src="/file.png" />
it does not appear
This is a different strategy I don’t want to pursue but proves that saving works…