displayname
displayname

Reputation: 13

Import bootstrap files with flask

I'm having trouble importing files to netbeans(IDE) with flask. So far, I have downloaded the bootstrap files and placed them in a folder called "static" (that I created), in the folder where my flask scripts and libraries are kept. On my html page I wrote :. And yes "url_for" was imported.

How can I make this work? For this case and future cases where I need to load different css files. Thanks in advance.

Upvotes: 1

Views: 497

Answers (1)

wanderlust
wanderlust

Reputation: 1936

For importing and using bootstrap you should add them to your static folder, i.e.:

<html>
  <head>
    <link rel="stylesheet" href="{{url_for('static', filename='bootstrap.min.css')}}">
  </head>

  <body>
  </body>
</html>

Please pay attention, that value in fieldname should points to Bootsrap's exact name and should include relative path from your static folder.

Upvotes: 2

Related Questions