0

Here is my directory hierarchy

flaskApp
|_ flaskApp.py
|_static
|  |_realsurfstyle.css
|
|_templates
  |_Realsurfhtml.html

Here is the relevant render_template from the flaskApp.py file

@app.route('/<surfBreak>')
def waveHeight(surfBreak):
    return render_template("Realsurfhtml.html", name=surfBreak)

Here is my code from the html file

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='static/realsurfstyle.css')}}"/>

I dont see what im missing?

David Owens
  • 645
  • 6
  • 25

1 Answers1

0

You don't have to place static in the file path to the .css file. In essence you're telling it that path to the file is /static/static/realsurfstyle.css so instead try and write the path as href="{{ url_for('static', filename='realsurfstyle.css')}}"

Additionally, I would recommend placing the .css files in a folder in the static directory labeled css. which would change the file path to href="{{ url_for('static', filename='css/realsurfstyle.css')}}"

BrettJ
  • 1,176
  • 2
  • 17
  • 33