静态文件(比如css啊,需要下载的各位文件等),需要通过static_file来操作,首先记得要在import中导入

 

@route('/static/<filename>')
def server_static(filename):
    return static_file(filename, root='/path/to/your/static/files')

 

使用bottle进行web开发(3):静态文件的获取

 

相关文章:

  • 2021-06-29
  • 2021-05-23
  • 2022-01-10
  • 2021-06-03
  • 2021-07-07
  • 2022-02-23
  • 2021-06-03
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-09-20
  • 2021-08-10
  • 2022-12-23
相关资源
相似解决方案