我剛剛嘗試從.tpl文檔引用我的樣式表時遇到了問題。 我的python,模板和css文檔都在同一個目錄下,但是當我使用CMD加載頁面到「localhost:8080」時,它顯示了沒有應用樣式的模板。無法在python加載的模板中引用css樣式表
在我的模板文件index.tpl裏我已經referenceed 3個樣式表:
<link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="animate-custom.css" />
我的Python文件輸出模板:index.py:
from bottle import route,template,debug,run
import sqlite3
@route('/')
def player():
return template('index.tpl')
debug(True)
run(reloader=True)
檢查我的其他答案:https://stackoverflow.com/a/45761391/3129414 – arsho