내 배경 이미지는 @ app.route ('/')가있는이 템플리트에서만 작동합니다.플라스크 템플리트에 배경 이미지를 설정하는 방법은 무엇입니까?
@app.route('/')
def home():
return render_template('post.html')
모든 작품 :
<header class="intro-header" style="background-image: url('static/img/home.jpg')">
이 때 완벽하게 잘 작동합니다. 나는이 얻을 :
127.0.0.1 - - [19/Sep/2016 21:07:11] "GET /static/img/home.jpg HTTP/1.1" 304
을하지만과 같은 템플릿을 사용할 때 :
127.0.0.1 - - [19/Sep/2016 21:15:23] "GET /post/static/img/home.jpg HTTP/1.1" 404 -
그리고 배경 이미지 비어 :
@app.route('/post/')
def post():
return render_template('post.html')
나는이 얻을.
사이트 관련 링크 : 'url (/ static/...)'및 문서 상대가 아닙니다. – hjpotter92