我正在尝试在Windows Server 2012上托管Flask Web应用程序。 我已按照http://developer.e-power.com.kh/publish-flask-on-iis/中的说明操作 起初它没有用,但在启用HTTP激活Windows功能后,我能够在浏览http://localhost:80/后收到以下错误消息:
Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "c:\inetpub\wwwroot\convnet\wfastcgi.py", line 711, in main env, handler = read_wsgi_handler(response.physical_path)
File "c:\inetpub\wwwroot\convnet\wfastcgi.py", line 568, in read_wsgi_handler return env, get_wsgi_handler(handler_name)
File "c:\inetpub\wwwroot\convnet\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:
按照上面链接中的说明自动生成的web.config文件是:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="FlaskHandler" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Python27\python.exe|c:\inetpub\wwwroot\convnet\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
答案 0 :(得分:0)
确保您可以从app.py导入app对象。看起来没找到它:
ValueError: "app.app" could not be imported