summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth House <seth@eseth.com>2014-04-17 02:46:31 -0600
committerSeth House <seth@eseth.com>2014-04-17 02:46:31 -0600
commit5b6d59834b4d5057d52de30f32f9791d4dc551d1 (patch)
treeba4169a5977084abb5ba7a49d925d8ad30ff369f
parent4775c0ecea3b32c58024a174c2f0a9f01cefb152 (diff)
downloadcherrypy-5b6d59834b4d5057d52de30f32f9791d4dc551d1.tar.gz
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: