Crap Nullpointer Exceptions
This is the blog of John Dulaney, a hacker of Fedora, SCAdian, player of Music, blacksmith, sailor, and consumer of Bacon.
Better way of importing css stylesheets in Flask
February 25, 2015
Posted by on Flask is pretty cool. But, I ran into a little snag today where if I used dynamic urls, my stylesheets broke. The solution is url_for in the head section of your base template (or otherwise). You can get it to work by using the following for inserting your css:
<link rel=”stylesheet” type=”text/css” href=”{{ url_for(‘static’, filename=’style.css’) }}”>