title: Importing .py file is breaking flask app
body: <p>I have a very simple flask app that imports a py file in a different folder and returns output.  Here is my flash app code:</p>
  
  <pre><code>from flask import Flask, request
  app = Flask(__name__)
  
  @app.route('/login', methods=['POST'])
  def flask_test():
      # Imports login.py from python/libs folder
      from python.libs import login
      # input coming from a .php file 
      host = request.form.get('Distro','')
      #simple py file to test login and return pass or fail
      result = login.telnet_host(host)
      return result
  
  if __name__ == '__main__':
      app.run()   
  </code></pre>
  
  <p>I know code and flask works because if I comment out import line, and add some test code I get a correct response.  I also created a test.py file on same folder and used same import command and running "python test.py" works fine as well.  However for some reason, import statement in flask.py file is not working.         </p>
  
  <p>if I do " python flask_home.py" I get no errors and see this:</p>
  
  <pre><code>* Running on http://127.0.0.1:5000/
  </code></pre>
  
  <p>but when I go to web and add the host name in host filed and hit submit it gives me 500 server error.  Again, If I comment out import line and add test code it works.  I even moved file in same folder and modified import line to "import login" but it still wouldn't work.</p>
  
  <p>Does anybody knows why import is breaking it?  My flask.py file is in /var/www and my login.py file is in /var/www/python/libs.  I can not move both in same folder unfortunately.  Please advice. </p>
  
  <p>Thanks</p>