Reputation: 51
I am trying to edit my CSS code in the static
folder.
But the problem is: Flask is not reloading CSS changes.
<head>
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='style.css') }}">
</head>
I expected the changes but there is no change on editing the css file.
Upvotes: 4
Views: 5572
Reputation: 815
You need to set reload template to true
app = Flask(__name__)
app.config["TEMPLATES_AUTO_RELOAD"] = True
Upvotes: 0
Reputation: 2320
You can use:
FLASK_RUN_EXTRA_FILES
environment variable--extra-files
commandline argapp.run()
see extra files docs
Upvotes: 1
Reputation: 1311
I had the same problem and it was the browser cache not clearing out. I found a solution for Chrome and Firefox: hold down the Shift key while clicking the reload button
Upvotes: 14
Reputation: 963
My guess is that static files are not checked for changes, even when Flask runs in debug mode. Additionally, CSS files are rather more browser related than to the application itself.
Regards, Thomas
Upvotes: 0