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 | 28bdc12d95490c9ed2e0f16f7b5d5d607770ae0f (patch) | |
tree | 5fbae1080884a8c774caab3ca30ffb03c087dd64 /docs | |
parent | df9e68f5d1d9ab5d59831feffbc30a690e9334bb (diff) | |
download | cherrypy-git-28bdc12d95490c9ed2e0f16f7b5d5d607770ae0f.tar.gz |
Added details on specifying an index file.
Diffstat (limited to 'docs')
-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 ^^^^^^^^^^^^^^^^^^^^^^^ |