title: Tornado - why does static files without StaticFileHandler donot work?
body: <p>I am new to Tornado. I am trying to link a CSS file to the html template. I am using jinja2 with Tornado. But due to some unknown reasons the CSS file is not loading up.</p>
  
  <p><strong>EDIT</strong>: I have created my custom <code>render_template</code> function which is working fine.</p>
  
  <p>Directory structure:</p>
  
  <pre><code>app.py
  static
      css
          custom.css
  templates
      index.html
  </code></pre>
  
  <p>Here is my Request Handler's Class:</p>
  
  <pre><code>class Index(RequestHandler):
  def get(self):
      path = os.path.join('static/css/', 'custom.css')
      return self.write(render_template('index.html', path = path))
  </code></pre>
  
  <p>and here is my <code>index.html</code> template:</p>
  
  <pre><code>&lt;!Doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;link rel="stylesheet" type="text/css" href="{{path}}"/&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div&gt;
        &lt;div class="header"&gt;
           asdasdasd
        &lt;/div&gt;
      &lt;/div&gt;&lt;!--wrapper--&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>but the browser is returning the <code>404-NotFound</code> error for the css file with the correct url, that is <code><a href="http://localhost/static/css/custom.css" rel="nofollow">http://localhost/static/css/custom.css</a></code></p>