Python Forum
Flask, Display a picture outisde the static
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask, Display a picture outisde the static
#6
First big thank you to Snippsat for your last reply how can do the trick ! (if found another way that I will share with below.)


(Aug-25-2020, 06:00 AM)ndc85430 Wrote: Why would you put static files in the same directory as your templates? Why do you want to avoid using the static directory as suggested?
Indeed good question.
because I found the default mechanism prone to generate mess in your files system.

If you have a template\something\index.html linked with a static\something
when one day you will want to delete you something you have have to delete it from your code from template\something\index.html and most probably you will not deleted static\something because you forgot or other page rely on it.. so it' start to generate garabage.

instated if everything related to template\something\index.html is in the same path and sub folder. once you delete the main folder all the childs are gone in the same moment. So way easier to keep organized and avoid garbage.

My solution
I created a folder junction from template\about\static to static\about :) so (in Windows) if I deleted template\about\ it will deleted also the junction inside the \static :D

stackoverflow not helpful
I have to admit I asked my question there also but WTF !? I'll open another topic for that.
So just to give a big Heart to python-forum.io who is way more human !and where we can solve, express our ideas ! Big thanks !
[Image: NfRQr9R.jpg]
Reply


Messages In This Thread
RE: Flask, Display a picture outisde the static - by SpongeB0B - Aug-29-2020, 07:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [Solved] Private static files SpongeB0B 1 1,164 Jul-16-2022, 05:36 AM
Last Post: SpongeB0B
  SHow image in a static link of Django pycada 3 2,660 Mar-04-2020, 01:50 AM
Last Post: pycada
  display multiple sensors on webpage python flask jinja pascale 6 5,431 Jan-29-2019, 10:10 AM
Last Post: pascale
  flask requests display data from api on webpage with javacript pascale 0 2,843 Oct-25-2018, 08:30 PM
Last Post: pascale
  Django loading static files Dutchpy 7 24,231 Oct-13-2017, 10:25 AM
Last Post: hbknjr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020