title: HTML templating using Jinja2 No module named your app
body: <p>I am trying to create a html template in python using Jinja2. I have a templates folder with my 'template.html' but I don't know how to deal with environments or package loaders.</p>
  
  <p>I installed Jinja2. These my simple codes</p>
  
  <pre><code>from jinja2 import Environment, PackageLoader
  
  env = Environment(loader=PackageLoader('ap', 'templates'))
  template = env.get_template('template.html')
  print template.render(title='hello')
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>File "a.py", line 3, in &lt;module&gt;
      env = Environment(loader=PackageLoader('ap', 'templates'))
    File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.7-py2.7.egg/jinja2/loaders.py", line 214, in __init__
      provider = get_provider(package_name)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 213, in get_provider
      __import__(moduleOrReq)
  ImportError: No module named ap
  </code></pre>
  
  <p>This my folders</p>
  
  <pre><code>ap/
      __init__.py
      a.py
      templates/
          template.html
  </code></pre>
  
  <p>Where am I wrong ? Why I get this error "No module named your application"</p>