1

I am struggling to reference my static css files in my template index.html file

In my head tag in index.html I have:

<link href="{{ url_for('static', path='./styles.css') }}" rel="stylesheet">

It is giving me this error "Cannot resolve directory"

In main.py I have the files mounted like so:

app.mount("/static", StaticFiles(directory="static"), name="static")


Folder Structure:
├── Project_name
   ├── main.py
   ├── static
   │   ├── styles.css
   ├── Templates
   │   ├── index.html

What could be the cause of this, how can I specify the correct path?

bendowlingtech
  • 474
  • 3
  • 11

0 Answers0