1

I have a local server using Flask web framework running on my machine. What I want is to load an html file, which is stored in a folder inside the app directory tree, into an iframe. The iframe src points to "fld/file.html", so I'd say that the file is inside scope, but so far I haven't been able to get it to load. I keep getting a "Not Found" error.

What am I doing wrong? Is it a security issue? Can I do it using another approach?

el_technic0
  • 553
  • 6
  • 14

1 Answers1

1

Put the HTML file in your static folder: http://flask.pocoo.org/docs/quickstart/#static-files

dumbmatter
  • 9,351
  • 7
  • 41
  • 80
  • It worked. Even having a deeper folder structure inside the static folder. However, is it possible to have more flexibility for the definition of the application's folders? I mean something more complex than having a static and a template folder? – el_technic0 May 17 '12 at 15:29
  • Yes. There are a variety of ways to do that, depending on whether you prioritize simplicity for development or performance for production, and also depending on what web server you're using. This has some information: http://stackoverflow.com/questions/4239825/static-files-in-flask-robot-txt-sitemap-xml-mod-wsgi – dumbmatter May 17 '12 at 16:58