我想在Windows Server上使用WSGI來運行一個簡單的燒瓶應用程序。我一直運行到以下錯誤:wsgi_handler燒瓶錯誤
Error occurred while reading WSGI handler: Traceback (most recent call last): File "c:\inetpub\wwwroot\test_site\wfastcgi.py", line 711, in main env, handler = read_wsgi_handler(response.physical_path) File "c:\inetpub\wwwroot\test_site\wfastcgi.py", line 568, in read_wsgi_handler return env, get_wsgi_handler(handler_name) File "c:\inetpub\wwwroot\test_site\wfastcgi.py", line 551, in get_wsgi_handler raise ValueError('"%s" could not be imported' % handler_name) ValueError: "app.app" could not be imported StdOut: StdErr
對於我的網站我配置了一個處理程序來調用Microsoft Web平臺安裝程序FastCGIModule
我的應用程序文件看起來是這樣的:
from flask import Flask, request, jsonify
from analyzers import analyzer
import write_log
app = Flask(__name__)
@app.route("/")
def test():
return "Test load"
@app.route('/analyze', methods=['POST'])
def parse():
text = request.json['text']
name = request.json['name']
model = request.json['model']
try:
convert_flag = request.json['convert_flag']
except KeyError:
convert_flag = False
results= analyzer(text, name, model, convert_dose=convert_flag)
write_log.write_log(text, name, model, results)
return jsonify(results)
if __name__ == "__main__":
app.run()
如果我將我的分析器腳本和我的write_log腳本的自定義導入以及POST方法會運行的註釋掉,所以我知道我必須在那裏搞點東西。
有沒有人有任何建議?
在此先感謝。
Paul
是你能得到的回答這個問題?謝謝 – labheshr
@labheshr對不起,我不是。從來沒有能夠弄清楚。 – PaulGlass