我一直在努力在Openshift中部署Flask应用程序。首先,我尝试部署我正在开发的应用程序。由于我没有成功,我决定创建一个示例Hello World并进行部署。503服务暂时不可用于Openshift Flask应用程序
这里是app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
app.run()
我做setup.py文件使用install_requirements代码:
from setuptools import setup
setup(name='SweetyPro',
version='1.0',
description='OpenShift App',
author='Your Name',
author_email='[email protected]',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['Django>=1.3',
'Flask==0.11.1'], )
我还设置了烧瓶中,requirements.txt的要求。然而,Openshift只是说它是一个暂时不可用的服务。
我检查了日志通过RHC尾-a my_application之,和它提示我:
==> app-root/logs/python.log <==
Traceback (most recent call last):
File "app.py", line 10, in <module>
app.run()
File "/var/lib/openshift/57976d4c7628e1a34e000179/python/virtenv/lib/python2.7/site-packages/Flask-0.11.1-py2.7.egg/flask/app.py", line 843, in run
run_simple(host, port, self, **options)
File "/var/lib/openshift/57976d4c7628e1a34e000179/python/virtenv/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/serving.py", line 694, in run_simple
inner()
File "/var/lib/openshift/57976d4c7628e1a34e000179/python/virtenv/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/serving.py", line 656, in inner
fd=fd)
File "/var/lib/openshift/57976d4c7628e1a34e000179/python/virtenv/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/serving.py", line 550, in make_server
passthrough_errors, ssl_context, fd=fd)
File "/var/lib/openshift/57976d4c7628e1a34e000179/python/virtenv/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg/werkzeug/serving.py", line 464, in __init__
HTTPServer.__init__(self, (host, int(port)), handler)
File "/opt/rh/python27/root/usr/lib64/python2.7/SocketServer.py", line 419, in __init__
self.server_bind()
File "/opt/rh/python27/root/usr/lib64/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/opt/rh/python27/root/usr/lib64/python2.7/SocketServer.py", line 430, in server_bind
self.socket.bind(self.server_address)
File "/opt/rh/python27/root/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied
谁能帮助我,好吗?我已经尽力了。谢谢!
无关:您可能不想安装Flask和Django。 – dirn
我也没有删除Django的依赖。还是一样。 – wagnerdelima