Python Forum
Flask do not accept sub-folder in Template ?! : Solved
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask do not accept sub-folder in Template ?! : Solved
#1
Thumbs Up 
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.
Reply
#2
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.
Reply
#3
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!).
SpongeB0B likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Moving flask app to sub folder on live site. Help This is driving me crazy **huh** Rosssaab 1 824 Jan-10-2025, 02:11 PM
Last Post: menator01
Question [Solved] Running Gunicorn with flask.... SpongeB0B 1 2,357 Jun-27-2022, 03:09 PM
Last Post: SpongeB0B
Question Flask, send_from_directory not working : solved SpongeB0B 2 10,189 Jan-26-2021, 07:02 AM
Last Post: SpongeB0B
  cant access root environment folder from django folder using __init__.py Sanjish 0 2,355 Dec-25-2020, 05:56 AM
Last Post: Sanjish
  show csv file in flask template.html rr28rizal 7 38,641 Nov-09-2020, 01:32 PM
Last Post: humanz
  how to pass javascript variables to url_for function in a flask template experimental 5 8,213 Oct-29-2020, 03:29 AM
Last Post: universe

Forum Jump:

User Panel Messages

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