summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Svingen <swoogan@gmail.com>2015-03-19 17:43:15 +0000
committerColin Svingen <swoogan@gmail.com>2015-03-19 17:43:15 +0000
commitd44714ce638f0cce22afbe1e92fd6d83ad328e26 (patch)
treef590a5b4328c745a5bc336ba3f00b22ab20e47e0
parentac0ae213face99777dab9356bdff08820e462180 (diff)
downloadcherrypy-d44714ce638f0cce22afbe1e92fd6d83ad328e26.tar.gz
Added details on specifying an index file.
-rw-r--r--docs/basics.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/basics.rst b/docs/basics.rst
index 3b9b3e68..2d1b500c 100644
--- a/docs/basics.rst
+++ b/docs/basics.rst
@@ -541,6 +541,25 @@ CherryPy will automatically respond to URLs such as
tools.staticdir.on = True
tools.staticdir.dir = "static"
+Specifying an index file
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+By default, CherryPy will repsond to the root of a static
+directory with an error. To specify an index file, you can use the
+following:
+
+.. code-block:: ini
+
+ [/static]
+ tools.staticdir.on = True
+ tools.staticdir.dir = "/home/site/static"
+ tools.staticdir.index = "index.html"
+
+Assuming you have a file at `static/index.html`,
+CherryPy will automatically respond to URLs such as
+`http://hostname/static/` by returning its contents.
+
+
Allow files downloading
^^^^^^^^^^^^^^^^^^^^^^^