summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Hellegouarch <sh@defuze.org>2014-05-05 21:11:16 +0200
committerSylvain Hellegouarch <sh@defuze.org>2014-05-05 21:11:16 +0200
commit564d46db0bb934da86420b60dd7e1b314a00d2f1 (patch)
tree8f439e40cd0185912d97545782eac3209269e2d8
parent9c551331f2de193843ccd35c04d2ffbb46099d61 (diff)
parent5b6d59834b4d5057d52de30f32f9791d4dc551d1 (diff)
downloadcherrypy-564d46db0bb934da86420b60dd7e1b314a00d2f1.tar.gz
Merged in whiteinge/cherrypy (pull request #70)
Added documentation on the staticdir.debug config
-rw-r--r--sphinx/source/progguide/files/static.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/sphinx/source/progguide/files/static.rst b/sphinx/source/progguide/files/static.rst
index f5c447a6..8a1becff 100644
--- a/sphinx/source/progguide/files/static.rst
+++ b/sphinx/source/progguide/files/static.rst
@@ -214,6 +214,15 @@ In any case by using the serve_file function we benefit from the CherryPy intern
Troubleshooting staticdir
=========================
+Adding the ``debug`` flag to the ``staticdir`` tool will output a log entry of
+the filesystem path it tried in order to resolve the given path.
+
+::
+
+ [/]
+ tools.staticdir.on = True
+ tools.staticdir.debug = True
+
When using staticdir, "root" and "dir" are concatenated using ``os.path.join``. So if you're having problems, try ``os.path.join(root, dir)`` in an interactive interpreter and make sure you at least get a valid, absolute path. Remember, you don't have to use "root" at all if you don't want to; just make "dir" an absolute path. If root + dir is not absolute, an error will be raised asking you to make it absolute. CherryPy doesn't make any assumptions about where your project files are, nor can it trust the current working directory, since that may change or not be under your control depending on your deployment environment.
Once root and dir are joined, the final file is found by ``os.path.join``'ing a ''branch''. The branch is pulled from the current request's URL like this: