涉及下边4处代码
1、模板中添加
<link rel="stylesheet" href="{{ url_for('static',path='/css/signin.css') }}"/>
<script type="text/javascript" src="{{ url_for('static',path='/js/test.js') }}">
2、py文件添加
app.mount("/static", StaticFiles(directory="./static"), name="static")
templates = Jinja2Templates(directory=r"C:\Users\admin\Desktop\ctrip\printer\templates")
return templates.TemplateResponse('/profile.html', {"request": request, "id_card": '23333232'})