The following codes are working without any problem in my system's localhost... But ain't doing the job on OpenShift.. There is something wrong with my wsgi.py.. Do I have to pass my username and password using environment variables OR I've need to change the localhost ?
The following is the tree of the directory/repository...
myflaskaws
├── requirements.txt
├── setup.py
├── static
│ ├── assets
│ │ ├── style.css
│ └── images
│ ├── no.png
│ └── yes.png
├── templates
│ ├── index.html
│ ├── login.html
│ ├── searchlist.html
│ ├── update.html
├── test.py
├── test.pyc
└── wsgi.py`
wsgi.py
#!/usr/bin/python
import os
virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
pass
from test import app as application
if __name__ == '__main__':
from wsgiref.simple_server import make_server
httpd = make_server('localhost', 8051, application)
print("Serving at http://localhost:8051/ \n PRESS CTRL+C to Terminate. \n")
httpd.serve_forever()
print("Terminated!!")
test.py
from flask import Flask
app = Flask(__name__)
PS : I'm not using "if name == 'main':" in test.py