The following is the result of CherryPy and css pathing problems I have recently posted, both of which have been answered, but another problem has arisen.
I have a html page which I preview in a browser (via. editor/IDE) and which calls a css file from a css folder in parallel with my application folder (containing main.py and My.html file). For this I use relative pathing in the html header...
<link rel="stylesheet" href="..\css\commoncss.css" type="text/css">
All good so far. However, when I run Main.py, the css file cannot be found, and the page looks a mess :-( The CP configuration file includes the following line...
tools.staticdir.root = "my\app\folder" # contains Main.py and My.html
but no other staticdir declarations because CP should be looking for ..\css\commoncss.css relative to the static root folder (am I right?)
I could have my CSS folder as a top-level folder (then I could use href="/css/commoncss" and declare /css as a staticdir), but that's ugly. Alternatively the CSS folder could be a subfolder of the app folder, but I really need the freedom to be able to put the .css file(s) in a different path if possible (could be common to more than one app.).
I really would like to crack this problem, because otherwise it means the html designer cannot use the same template as the Python programmer without changing the href directive.
Any help would be appreciated.
Alan