title: pyinstaller Template not found
body: <p>I used pyinstaller to create an executable, but I am getting these errors when I run the executable:    </p>
  
  <blockquote>
  <pre><code>&gt; Traceback (most recent call last):
  &gt;       File "flask/app.py", line 1988, in wsgi_app
  &gt;       File "flask/app.py", line 1641, in full_dispatch_request
  &gt;       File "flask/app.py", line 1544, in handle_user_exception
  &gt;       File "flask/app.py", line 1639, in full_dispatch_request
  &gt;       File "flask/app.py", line 1625, in dispatch_request
  &gt;       File "testforms.py", line 13, in my_form
  &gt;       File "flask/templating.py", line 133, in render_template
  &gt;       File "jinja2/environment.py", line 851, in get_or_select_template
  &gt;       File "jinja2/environment.py", line 812, in get_template
  &gt;       File "jinja2/environment.py", line 774, in _load_template
  &gt;       File "flask/templating.py", line 57, in get_source
  &gt;       File "flask/templating.py", line 85, in _get_source_fast
  &gt;       TemplateNotFound: template.html
  </code></pre>
  </blockquote>
  
  <p>When I run this script locallly, it all works fine. </p>
  
  <p>Here is the script:</p>
  
  <pre><code>from flask import Flask                               
  from flask import request                             
  from flask import render_template                     
  app = Flask(__name__, template_folder='templates')    
  
  @app.route('/')                                       
  def my_form():                                        
      return render_template('/template.html' )         
  
      @app.route('/', methods=['POST'])                     
   def my_form_post():                                   
  
      text = request.form['text']                       
      processed_text = text.upper()                     
      print processed_text                              
      return processed_text                             
  
  if __name__ == '__main__':                            
      app.run()                         
  </code></pre>
  
  <p>To build the executable I used:</p>
  
  <pre><code>pyinstaller --onefile testforms.py
  </code></pre>
  
  <p>I also tried: </p>
  
  <pre><code>return render_template('template.html' ) 
  </code></pre>