diff options
author | Colin Svingen <swoogan@gmail.com> | 2015-03-19 17:43:15 +0000 |
---|---|---|
committer | Colin Svingen <swoogan@gmail.com> | 2015-03-19 17:43:15 +0000 |
commit | d44714ce638f0cce22afbe1e92fd6d83ad328e26 (patch) | |
tree | f590a5b4328c745a5bc336ba3f00b22ab20e47e0 | |
parent | ac0ae213face99777dab9356bdff08820e462180 (diff) | |
download | cherrypy-d44714ce638f0cce22afbe1e92fd6d83ad328e26.tar.gz |
Added details on specifying an index file.
-rw-r--r-- | docs/basics.rst | 19 |
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 ^^^^^^^^^^^^^^^^^^^^^^^ |