I'm having trouble creating a static XML stylesheet to accompany some dynamically generated output from a CherryPy web application. Even my test case serving a static text file fails.
The static file blah.txtis located in a directory /staticin the root directory of the application.
In my main site file (conesearch.py contains the CherryPy ConeSearch page handler class):
import conesearch
cherrypy.config.update('site.config')
cherrypy.tree.mount(conesearch.ConeSearch(), "/ucac3", 'ucac3.config')
...
And in site.configI have the following options:
[/]
tools.staticdir.root: conesearch.current_dir
[/static]
tools.staticdir.on: True
tools.staticdir.dir: 'static'
where current_dir = os.path.dirname(os.path.abspath(__file__))inconesearch.py
However, my simple test page (taken directly from http://www.cherrypy.org/wiki/StaticContent ) fails 404:
def test(self):
return """
<html>
<head>
<title>CherryPy static tutorial</title>
</head>
<body>
<a href="/static/blah.txt">Link</a>
</body>
</html>"""
test.exposed = True
127.0.0.1:8080/static/blah.txt, AOK. ?
,