Windows で Flask を Apache から実行しようとしていますが、以下のエラー メッセージが表示されます。この問題の原因について何か考えはありますか?
エラーメッセージ:
mod_wsgi (pid=4380): Exception occurred processing WSGI script 'C:/I4/importicus/importicus.wsgi'.
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] Traceback (most recent call last):
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1701, in __call__
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] return self.wsgi_app(environ, start_response)
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1689, in wsgi_app
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] response = self.make_response(self.handle_exception(e))
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1687, in wsgi_app
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] response = self.full_dispatch_request()
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1360, in full_dispatch_request
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] rv = self.handle_user_exception(e)
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1358, in full_dispatch_request
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] rv = self.dispatch_request()
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] File "C:\\Python26\\lib\\site-packages\\flask-0.9-py2.6.egg\\flask\\app.py", line 1344, in dispatch_request
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] return self.view_functions[rule.endpoint](**req.view_args)
[Fri Nov 30 14:47:47 2012] [error] [client 192.168.100.109] TypeError: application() takes exactly 2 arguments (0 given)
私のWSGIファイルは次のようになります。
import sys
sys.path.insert(0, "c:\i4\importicus")
from importicus import importicus_main as application
application.debug = True
私のアプリケーションファイルは次のようになります。
from flask import Flask, render_template,jsonify, request
from werkzeug import secure_filename
import importicus_functions
import ast, os, sys
importicus_main = Flask(__name__)
UPLOAD_FOLDER = 'uploads'
TEMPLATE_FOLDER = 'templates'
importicus_main.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
importicus_main.config['TEMPLATE_FOLDER'] = TEMPLATE_FOLDER
@importicus_main.route('/')
def application(environ, start_response):
status = '200 OK'
output = "Hello World! INSIDE"
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]