python - Cartridge Python2.7 on OPenshift -


i try install django 1.5 on host openshift. use cartridge python 2.7. read https://developers.openshift.com/en/python-getting-started.html. did not understand code should be.

virtenv = os.environ['openshift_python_dir'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try:   # see: http://stackoverflow.com/questions/23418735/using-python-3-3-in-openshifts-book-example?noredirect=1#comment35908657_23418735   #execfile(virtualenv, dict(__file__=virtualenv)) # python v2.7   #exec(compile(open(virtualenv, 'rb').read(), virtualenv, 'exec'), dict(__file__=virtualenv)) # python v3.3   # multi-line python v3.3:   exec_namespace = dict(__file__=virtualenv)   open(virtualenv, 'rb') exec_file:   file_contents = exec_file.read()   compiled_code = compile(file_contents, virtualenv, 'exec')   exec(compiled_code, exec_namespace) except ioerror: pass  

this code should in file wsgi.py? appeal, give me sample working application on cartridge python openshift.

yes, code should go in wsgi.py file.

for example (although example uses version 3.3, it'll point in right direction), @ comments under answer provided: using python 3.3 in openshift's book example


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -