2016-11-25 21 views
1

我具有長頸瓶的應用程序如下:失敗告終瓶應用

socketio2.run(app2, host="0.0.0.0", port=4998) 

我創建到結束它的方法如下:

def shutdown_server(): 
    func = request.environ.get('werkzeug.server.shutdown') 
    if func is None: 
     raise RuntimeError('Not running with the Werkzeug Server') 
    func() 

@app2.route('/shutdown', methods=['POST']) 
def shutdown(): 
    shutdown_server() 
    print " shutdown" 
    return 'Server shutting down...' 

我收到以下錯誤

內部服務器錯誤

服務器遇到int ernal錯誤,無法完成您的請求 。服務器超載或在應用程序中出現錯誤 。

我的目標是結束這個Flask應用程序,然後運行一個Python腳本。有什麼建議麼 ?

+0

你有進口的請求模塊的工作嗎?即:'從燒瓶進口請求' –

+0

是的,我已經導入它 –

回答