问答详情
源自:7-6 Jinja2 模板渲染前端页面

报错了,starlette.routing.NoMatchFound: No route exists for name "static" and params "path".

报错了,starlette.routing.NoMatchFound: No route exists for name "static" and params "path".



http://img4.mukewang.com/63bad84200013e3315450773.jpg


http://img2.mukewang.com/63bad85d0001d1be15450773.jpg

提问者:52856458 2023-01-08 22:51

个回答

  • weixin_宝慕林3183823
    2024-08-05 17:07:04

    需要在run.py文件中添加这行命令且就可以运行成功了
    app.mount(path='/static', app=StaticFiles(directory="./coronavirus/static"), name='static')


  • weixin_宝慕林3183823
    2024-08-05 17:01:59

    同问,我也遇到这个问题