title: url_for is not defined in Flask
body: <pre><code>import os
  from jinja2 import Environment, FileSystemLoader
  env = Environment(loader=FileSystemLoader('templates'))
  from flask import Flask,url_for
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
      tmpl = env.get_template('index.html')
      sidebar = env.get_template('sidebar.html')
      return tmpl.render(root_url="",sidebar=sidebar.render())
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>and in tempaltes/index.html</p>
  
  <pre><code>{{ url_for('static', filename='js/main.js') }}
  </code></pre>
  
  <p>Though, I get url_for is not defined? I am trying to follow the examples online but I don't know why I get this</p>