2017-10-11 34 views
-2

我想HTML和CSS文件連接在瓶的應用程序(pycharm IDE),但沒有得到如何做this.Here連接在瓶中的web應用程序的HTML和CSS文件的截圖image link在pycharm

+0

在問題中增加'flaskdata.py'的代碼。讓我們看看你一直試圖添加模板。 – arsho

回答

0

在模板文件中添加CSS/JS使用:

<link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}"> 

flaskdata.py(我想這是主文件),使所添加的模板:

from flask import render_template, flash, redirect, request, url_for 
@app.route('/') 
def index(): 
    return render_template('index.html') 

因此你可以繼續在模板中添加靜態CSS/JS文件,並在適當的路線中呈現所需的模板。