Tutorial — Bottle 0.13-dev documentation
static_files (css, images,...)
from bottle import static_file
@route('/images/<filename:re:.*\.png>')
def send_image(filename):
return static_file(filename, root='/path/to/image/files', mimetype='image/png')
@route('/static/<filename:path>')
def send_static(filename):
return static_file(filename, root='/path/to/static/files')
permalink -
-
http://bottlepy.org/docs/dev/tutorial.html#static-files