title: Flask framework on Openshift unable to load module
body: <p>So I have created a flask application in OS from the OS quickstart on github. The app works great on my local system. when i push the app to OS it builds but I get an error 500 in the browser.</p>
  
  <p>Any ideas or assistance would be appreciated.</p>
  
  <p>Here is the source code from the application file:</p>
  
  <pre><code>#!/usr/bin/python import os
  
  virtenv = os.environ['APPDIR'] + '/virtenv/'
  os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages')
  virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
  try:
      execfile(virtualenv, dict(__file__=virtualenv))
  except IOError:
      pass
  
  from run import app as application
  </code></pre>
  
  <p>Here is the source from the run.py file</p>
  
  <pre><code>from app import app 
  app.run(debug = True)
  </code></pre>
  
  <p>Here are the errors from the logs (Stripped the HASH ID for my site):</p>
  
  <pre><code>[Sun Aug 05 15:46:08 2012] [error] * Running on http://127.0.0.1:5000/
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] mod_wsgi (pid=28484): Target WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application' cannot be loaded as Python module. 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] mod_wsgi (pid=28484): Exception occurred processing WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application'. 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] Traceback (most recent call last): 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application", line 13, in &lt;module&gt; 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] from run import app as application 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/run.py", line 2, in &lt;module&gt; 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] app.run(debug = True) 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Flask-0.9-py2.6.egg/flask/app.py", line 739, in run 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] run_simple(host, port, self, **options) 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 613, in run_simple 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] test_socket.bind((hostname, port)) 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] File "&lt;string&gt;", line 1, in bind 
  [Sun Aug 05 15:46:08 2012] [error] [client 127.3.153.129] error: [Errno 13] Permission denied 
  [Sun Aug 05 15:46:09 2012] [error] * Running on http://127.0.0.1:5000/
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] mod_wsgi (pid=31302): Target WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application' cannot be loaded as Python module. 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] mod_wsgi (pid=31302): Exception occurred processing WSGI script '/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application'. 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] Traceback (most recent call last): 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/application", line 13, in &lt;module&gt; 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] from run import app as application 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/app-root/runtime/repo/wsgi/run.py", line 2, in &lt;module&gt; 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] app.run(debug = True) 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Flask-0.9-py2.6.egg/flask/app.py", line 739, in run
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] run_simple(host, port, self, **options) 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "/var/lib/stickshift/HASH-ID-HERE/ws/virtenv/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 613, in run_simple 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] test_socket.bind((hostname, port)) 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] File "&lt;string&gt;", line 1, in bind 
  [Sun Aug 05 15:46:09 2012] [error] [client 127.3.153.129] error: [Errno 13] Permission denied
  </code></pre>