title: Static files in cherrypy
body: <p>I'm using Cherrypy 3.2.3 , Python 2.7.3.
  Code:</p>
  
  <pre><code>from jinja2 import Environment, FileSystemLoader
  import cherrypy
  import os
  
  folder=os.path.abspath(os.curdir)
  
  class Root(object):
      @cherrypy.expose
      def index(self):
          j2_env = Environment(loader=FileSystemLoader(folder), trim_blocks=True) 
          return j2_env.get_template('index.html').render()
  
  
  
  cherrypy.config.update({
      'environment': 'production',
      'log.screen': True,
      'server.socket_host': '127.0.0.1',
      'server.socket_port': 28807,
  })
  
  conf = {'static': {'tools.staticdir.on': True,
                     'tools.staticdir.dir' : os.path.join(folder, 'static'),
                 'tools.staticdir.content_types' : {'html': 'application/octet-stream'}}}
  
  cherrypy.config.update(conf)
  
  print cherrypy.config
  print os.path.join(folder, 'static')
  cherrypy.quickstart(Root(), '/', config = conf)
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>{'environment': 'production', 'tools.trailing_slash.on': True, 'request.show_tracebacks': False, 'log.screen': True, 'tools.encode.on': True, 'tools.log_tracebacks.on': True, 'server.socket_port': 28807, 'checker.on': False, 'static': {'tools.staticdir.dir': '/home/ivan/cherypy/cherryblocks/static', 'tools.staticdir.content_types': {'html': 'application/octet-stream'}, 'tools.staticdir.on': True}, 'server.socket_host': '127.0.0.1', 'request.show_mismatched_params': False, 'tools.log_headers.on': False, 'engine.autoreload_on': False}</p>
    
    <p>/home/ivan/cherypy/cherryblocks/static</p>
  </blockquote>
  
  <p>I try to get <a href="http://127.0.0.1:28807/static/style.css" rel="nofollow">http://127.0.0.1:28807/static/style.css</a>:</p>
  
  <blockquote>
    <p>127.0.0.1 - - [22/Jan/2015:13:24:38] "GET /static/style.css HTTP/1.1" 404 730 "" "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0"</p>
  </blockquote>
  
  <p>Error 404.</p>
  
  <p>But I can open /home/ivan/cherypy/cherryblocks/static/style.css:</p>
  
  <p><code>stat /home/ivan/cherypy/cherryblocks/static/style.css</code></p>
  
  <blockquote>
    <p>File: «/home/ivan/cherypy/cherryblocks/static/style.css»
      Size: 2556</p>
  </blockquote>
  
  <p>How can cherrypy serve static files?</p>