I'm using webfaction as a webhost. I'm trying to serve my cherrypy application a css file but something isn't working. I've got my python application in
home/webapps/spotipy
and my css file in
home/webapps/spotipy/css
At the top of my python code I've got
#!/usr/local/bin/python3.2
import cherrypy
class Root(object):
@cherrypy.expose
def index(self):
return '''<html>
<head>
<title>Spoti.py</title>
<link rel="stylesheet" href="css/my_css.css" type="text/css" />
</head>
<p> hi </p>
<body>
<p> hi joey </p>
%s
</body></html>''' %text
And this at the bottom
cherrypy.quickstart(Root(),config={
'/css':
{ 'tools.staticdir.on':True,
'tools.staticdir.dir':"home/webapps/spotipy/css"
},
'/my_css.css':
{ 'tools.staticfile.on':True,
'tools.staticfile.filename':"home/webapps/spotipy/css/my_css.css"
}
})