title: Flask/Python application failed to start before deployment on Heroku
body: <p>I would like to deploy a Flask (python) app on Heroku, I did it before without any problem . 
  But now, I don't know what is the problem . </p>
  
  <p>The problem is here, When I enter the following command to test the local server : </p>
  
  <pre><code>foreman start
  </code></pre>
  
  <p>I have this error :</p>
  
  <pre><code>foreman start
  12:01:53 web.1  | started with pid 6055
  12:01:53 web.1  | 2013-12-25 12:01:53 [6058] [INFO] Starting gunicorn 18.0
  12:01:53 web.1  | 2013-12-25 12:01:53 [6058] [INFO] Listening at: http://0.0.0.0:5000 (6058)
  12:01:53 web.1  | 2013-12-25 12:01:53 [6058] [INFO] Using worker: sync
  12:01:53 web.1  | 2013-12-25 12:01:53 [6063] [INFO] Booting worker with pid: 6063
  12:01:53 web.1  | 2013-12-25 12:01:53 [6063] [ERROR] Exception in worker process:
  12:01:53 web.1  | Traceback (most recent call last):
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
  12:01:53 web.1  |     worker.init_process()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
  12:01:53 web.1  |     self.wsgi = self.app.wsgi()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
  12:01:53 web.1  |     self.callable = self.load()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
  12:01:53 web.1  |     return self.load_wsgiapp()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
  12:01:53 web.1  |     return util.import_app(self.app_uri)
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
  12:01:53 web.1  |     __import__(module)
  12:01:53 web.1  | ImportError: Import by filename is not supported.
  12:01:53 web.1  | Traceback (most recent call last):
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
  12:01:53 web.1  |     worker.init_process()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
  12:01:53 web.1  |     self.wsgi = self.app.wsgi()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
  12:01:53 web.1  |     self.callable = self.load()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
  12:01:53 web.1  |     return self.load_wsgiapp()
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
  12:01:53 web.1  |     return util.import_app(self.app_uri)
  12:01:53 web.1  |   File "/home/myhome/myApp/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
  12:01:53 web.1  |     __import__(module)
  12:01:53 web.1  | ImportError: Import by filename is not supported.
  12:01:53 web.1  | 2013-12-25 12:01:53 [6063] [INFO] Worker exiting (pid: 6063)
  12:01:53 web.1  | 2013-12-25 12:01:53 [6058] [INFO] Shutting down: Master
  12:01:53 web.1  | 2013-12-25 12:01:53 [6058] [INFO] Reason: Worker failed to boot.
  12:01:53 web.1  | exited with code 3
  12:01:53 system | sending SIGTERM to all processes
  SIGTERM received
  </code></pre>
  
  <p>My Procfile is :</p>
  
  <pre><code>web: gunicorn app/route:app
  </code></pre>
  
  <p>And I am using this main : </p>
  
  <pre><code>if __name__ == '__main__':
      import logging
      from logging.handlers import RotatingFileHandler
      handler = RotatingFileHandler('foo.log', maxBytes=10000, backupCount=1)
      handler.setLevel(logging.INFO)
      app.logger.addHandler(handler)
      if TODAY != cache.config['CACHE_ARGS'] :
          with app.app_context():
              cache.clear()
      port = int(os.environ.get('PORT', 33507))
      app.run(debug = True, host='0.0.0.0', port=port)
  </code></pre>
  
  <p>When I run the app on the browser (0.0.0.0:33507) it works perfectly .</p>