Trying to setup a WSGIProxy app, but failed. (error 500)

The OpenShift forums have been retired.
You can still read and search them, but for help, please post a question on Stack Overflow.

Hello all!

I'm trying to setup a (https://wsgi-proxy.readthedocs.org/en/latest/wsgi_proxy.html WSGIProxy) python 2.7 app(no scaling), but getting error 500.

app address: http://proxy-talh.rhcloud.com/

Here is the code:

setup.py:

from setuptools import setup
 
setup(name='Proxy',
      version='1.0',
      description='A simple python proxy.',
      author='Tal Hadad',
      author_email='example@example.com',
      url='http://www.python.org/sigs/distutils-sig/',
      install_requires=['wsgi-proxy>=0.3.0'],
     )

wsgi/application:

#!/usr/bin/python
import os
 
virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/'
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.7/site-packages')
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
    execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
    pass
#
# IMPORTANT: Put any additional includes below this line.  If placed above this
# line, it's possible required libraries won't be in your searchable path
# 
 
import wsgi_proxy
def application(environ, start_response):
 
    wsgi_proxy.app.handler(environ, start_response)
 
#
# Below for testing only
#
if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    httpd = make_server('localhost', 8051, application)
    # Wait for a single request, serve it and quit.
    httpd.handle_request()

Please help me

I opened up the log file, this is the trace:

* mod_wsgi (pid=21369): Exception occurred processing WSGI script '/var/lib/openshift/5256d9cfe0b8cd7081000032/app-root/runtime/repo/wsgi/application'.
* [error] [client 127.5.51.1] TypeError: 'NoneType' object is not iterable

Any clue what I'm doing wrong?

Is there anything else around that message that included a line number from your script or anything?