I want to set my http server's static directory, and put some pictures in it, so that users can get my pictures use the url. But I failed, code below does not work:
# 静态路径
STATIC_DIRNAME = "resources"
# 设置static path
settings = {
"static_path": os.path.join(os.path.dirname(__file__), STATIC_DIRNAME),
}
# and I passed settings to Application
app = tornado.web.Application([
(r"/pictures", handler.PicturesHandler),
], **settings)
How can I set the static directory to "resources"?
(I want to get my picture through url such as: localhost:8888/resources/1.jpg
)
Use static_url_prefix