Python Forum

Full Version: Flask do not accept sub-folder in Template ?! : Solved
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I just realize that apparently we cannot create sub-folder in Templates ! :/

Is that the normal behavior ? if yes , WHY ?


render_template('test\test.html')
Give me an error

render_template('test.html')
work fine.
I'm too much used to use \ so with

render_template('test/test.html')
it's work !

/ instead of \ too bad the error message was not more explicit.
Remember that \ is used to specify an escape sequence (e.g. \t is the escape sequence for a tab). If you want to include a literal \ in a string, you should use a raw string (or escape it of course!).