I am learning how to build flask applications. But, whenever I write some CSS code, and link that to my html template, the css never gets applied. No matter what I do.
Here is the line that links my html template to my css file:
<link rel="stylesheet" href="{{ url_for('static',filename='css/base.css') }}">
Here is what I did:
- I tried restarting my server.
- I searched for this online. This is what I found: CSS not being applied in Flask app. However, even that did not help.
I believe my server does not find my css file, because this is the entire output in my terminal:
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 222-949-106
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [11/Nov/2020 21:18:46] "GET /login HTTP/1.1" 200 -
127.0.0.1 - - [11/Nov/2020 21:18:47] "GET /login HTTP/1.1" 200 -
As you can see, my css file is not mentioned anywhere. Where is the mistake? Please help me.