title: Python Tornado render static directory
body: <p>I am trying to serve a page from a static directory using the Tornado API in Python. <a href="https://stackoverflow.com/questions/23988185/tornado-python-self-renderexample-html-ignores-css">This answer is similar to what I am trying to do</a>, but I can't seem to get it to work.</p>
  
  <p>My directory structure looks like this (all of the static files are inside a folder called <code>web</code>):</p>
  
  <p><img src="https://i.stack.imgur.com/d5o9F.png" alt="directory file structure"></p>
  
  <p>I have a webserver setup like this:</p>
  
  <pre><code>class Application(tornado.web.Application):
      def __init__(self):
          handlers = [
              (r'/ws', WSHandler),
              (r'/', IndexHandler),
          ]
          settings = {
              "debug": True,
              "static_path": os.path.join(os.path.dirname(__file__), "web")
          }
          tornado.web.Application.__init__(self, handlers, **settings)
  
  http_server = tornado.httpserver.HTTPServer(Application())
  http_server.listen(8888)
  tornado.ioloop.IOLoop.instance().start()
  </code></pre>
  
  <p>I thought this line:</p>
  
  <pre><code>"static_path": os.path.join(os.path.dirname(__file__), "web")
  </code></pre>
  
  <p>might have fixed the problem, but when I point to the <code>index.html</code> file:</p>
  
  <pre><code>class IndexHandler(tornado.web.RequestHandler):
      @tornado.web.asynchronous
      def get(self):
          self.render('web/index.html')
  </code></pre>
  
  <p>It serves the page as expected, but prints this error message to the console:</p>
  
  <pre><code>WARNING:tornado.access:404 GET /css/reset.css (::1) 3.57ms
  WARNING:tornado.access:404 GET /js/lib/custom-marker.js (::1) 0.96ms
  WARNING:tornado.access:404 GET /js/map.js (::1) 2.08ms
  WARNING:tornado.access:404 GET /js/websocket-client.js (::1) 1.56ms
  WARNING:tornado.access:404 GET /css/index.css (::1) 0.89ms
  </code></pre>
  
  <p>In this minimalistic example, how do I fix my problem? Where is it trying to point and not being able to find the files?</p>
  
  <p>Any help you could offer would be greatly appreciated!</p>