0
我有一个问题,加载我的CSS与CherryPy管理的HTML页面。 这是我的情况:cherrypy,服务的css文件,错误的路径
class HelloWorld(object):
@cherrypy.expose
def index(self):
return "Hello world!"
@cherrypy.expose
def sc(self):
Session = sessionmaker()
session = Session(bind=engine)
...
...
if __name__ == '__main__':
cherrypy.quickstart(HelloWorld(),config={
'/':
{'tools.staticdir.root': True,
'tools.staticdir.root': "Users/mypc/Desktop/data"},
'/css':
{ 'tools.staticdir.on':True,'tools.staticdir.dir':"/css" },
'/style.css':
{ 'tools.staticfile.on':True,
'tools.staticfile.filename':"/style.css"}
})
当我启动我的剧本有wrtten:
CherryPy Checker:
dir is an absolute path, even though a root is provided.
'/css' (root + dir) is not an existing filesystem path.
section: [/css]
root: 'Users/mypc/Desktop/data'
dir: '/css'
但根+ dir是正确的道路(用户/ MYPC /桌面/数据/ CSS) 哪里我错了,为什么我不能通过浏览器打开我的CSS?
在此先感谢
完美!谢谢!我只需要将根部分添加到配置! – user2174050 2014-11-04 16:52:50