bottle强制下载

1
2
3
4
5
6
7
8
9
from bottle import route,run,static_file


@route("/<filename:path>")
def f(filename):
return static_file(filename, root="./bottle项目框架/static/img" ,download=True) #打开网页就会强制下载


run(port=8088,reloader=True)

转载请注明来源 https://tianweiye.github.io