My background-image works only for this template that has @app.route('/').
<header class="intro-header" style="background-image: url('static/img/home.jpg')">
This works perfectly fine when:
@app.route('/')
def home():
return render_template('post.html')
Everything works. I get this:
127.0.0.1 - - [19/Sep/2016 21:07:11] "GET /static/img/home.jpg HTTP/1.1" 304
But when I use same template with:
@app.route('/post/')
def post():
return render_template('post.html')
I get this:
127.0.0.1 - - [19/Sep/2016 21:15:23] "GET /post/static/img/home.jpg HTTP/1.1" 404 -
And background-image is blank.


所有评论(0)