bottle静态图片文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from bottle import route, run, static_file

@route('/')
def f():
return "网页入口"

@route('/<filename:re:.*.[jpg|gif|png]$>')
def f2(filename):
return static_file(filename, root='./bottle项目框架/static/img')#img文件根目录

@route('/<filename:re:.*.[css]$>')
def f3(filename):
return static_file(filename, root='./bottle项目框架/static/css')#css文件根目录



run(port=8088, reloader=True)

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