我一直在努力在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