Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask Issues
#10
In a css file "url_for" will not work,and will give error as you get.
Can give relative path to image in css file.
If a make a "style.css" in my demo code with this in it.
body {          
 background-image: url('../images/back.jpg');
 background-repeat-x: no-repeat;
 background-repeat-y: no-repeat;
}
In index.html i call "style.css" like this in head.
<head>
  <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/style.css') }}" />    
</head>
Reply


Messages In This Thread
Flask Issues - by iainstott - Oct-27-2016, 06:02 PM
RE: Flask Issues - by micseydel - Oct-27-2016, 06:58 PM
RE: Flask Issues - by iainstott - Oct-27-2016, 07:13 PM
RE: Flask Issues - by micseydel - Oct-27-2016, 07:26 PM
RE: Flask Issues - by iainstott - Oct-27-2016, 07:50 PM
RE: Flask Issues - by iainstott - Oct-28-2016, 11:54 AM
RE: Flask Issues - by iainstott - Oct-28-2016, 02:05 PM
RE: Flask Issues - by snippsat - Oct-28-2016, 02:52 PM
RE: Flask Issues - by iainstott - Oct-28-2016, 04:01 PM
RE: Flask Issues - by snippsat - Oct-28-2016, 05:17 PM
RE: Flask Issues - by iainstott - Oct-29-2016, 02:38 PM
RE: Flask Issues - by snippsat - Oct-29-2016, 04:09 PM
RE: Flask Issues - by iainstott - Oct-29-2016, 06:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  flask issues with app structuring sidk23396 1 1,792 Feb-12-2020, 11:41 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020