OpenShift recently published a book, \"Getting Started with OpenShift\". It is a good guide for someone just starting out.
In Chapter 3 they show how to modify a templat
As indicated in this question, you can replace the line
execfile(virtualenv, dict(__file__=virtualenv))
by
exec(compile(open(virtualenv, 'rb').read(), virtualenv, 'exec'), dict(__file__=virtualenv))
In my opinion, it would be better to break this up into a few simpler pieces. Also we should use a context handler for the file handling::
with open(virtualenv, 'rb') as exec_file:
file_contents = exec_file.read()
compiled_code = compile(file_contents, virtualenv, 'exec')
exec_namespace = dict(__file__=virtualenv)
exec(compiled_code, exec_namespace)
Breaking it up in this way will also make debugging easier (actually: possible). I haven't tested this but it should work.
If you are facing issues with virtualenv settings on wsgi.py
file in Python3 I have solved just deleting it.
This is my wsgi.py file and it's working
#!/usr/bin/python
from flaskapp import app as application
if __name__ == '__main__':
from wsgiref.simple_server import make_server
httpd = make_server('0.0.0.0', 5000, application)
# Wait for a single request, serve it and quit.
#httpd.handle_request()
httpd.serve_forever()