2013-05-10 68 views
1

我的瓶的應用程序是在$OPENSHIFT_REPO_DIR/repo目錄與文件作爲瓶應用程序無法啓動,服務器表示HTTP 500

..repo$ ls 
runserver.py app.py 

和我app.py看起來像

def run_simple_httpd_server(app, ip, port=8080): 
    from wsgiref.simple_server import make_server 
    make_server(ip, port, app).serve_forever() 

if __name__ == '__main__': 
    ip = os.environ['OPENSHIFT_INTERNAL_IP'] 
    port = 8080 
    from runserver import run 
    run_simple_httpd_server(run, ip, port) 

runserver.py看起來像

from configuration import app 
from core.expense import expense 
from core.budget import budget 

def run(): 
    app.register_blueprint(budget) 
    app.register_blueprint(expense) 
    app.run() 

當我重新啓動我的應用程序時,我沒有看到任何事情發生荷蘭國際集團

\> ctl_app restart 

當我打的網址在瀏覽器中,它說

A server error occurred. Please contact the administrator.

我甚至不看日誌的任何地方,那是什麼,我做錯了什麼?

我正在做的第一次部署

回答

0

我不得不從app.py調用我的應用程序,我做以下,並得到我的應用程序運行

cd ~/app_root/repo 
vi app.py 

# change last part of file to 
# you need to do every time code is pushed via git push 
if __name__ == '__main__': 
    ip = os.environ['OPENSHIFT_INTERNAL_IP'] 
    port = 8080 
    from runserver import run 
    run(ip, port) 

# restart app 
ctl_app restart 

和我runserver.py看起來像

def run(host, port): 
    from configuration import app 
    app.run(host=host, port=port) 
1

你是如何部署你的燒瓶應用程序?你在github上使用Flask示例:https://github.com/openshift/flask-example

總體而言,您不應該被要求從設備上的ssh啓動您的應用程序,因爲我們的啓動/停止掛鉤應該可以處理該應用程序。嘗試一下燒瓶示例。否則,您可以查看日誌解決您的500錯誤: https://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs

+0

謝謝,我不得不在我的app.py中加入我的應用程序並運行它並修復它 – daydreamer 2013-05-11 05:10:37

相關問題