All public files (the ones that are not processed, like templates or python files) should be placed into dedicated static folders. By default, Jinja2 has one static folder called static
.
This should fix your problem:
-
Move
/templates/styles.css
to/static/styles.css
-
Update your code with following code, that will be translated into correct file location:
<link rel="stylesheet" href="https://stackoverflow.com/questions/25034812/{{ url_for("static', filename="https://stackoverflow.com/questions/25034812/styles.css") }}">
More info on static files in Jinja2 is here.