问题描述
我一直在尝试使用 IIS 部署 django 应用程序,但在执行完所有步骤后,我遇到了以下错误
if (str is null || str == string.Empty)
{
throw new Exception("Wrong str");
}
我知道这个错误是由于脚本处理器值的路径不正确,但提到的值是正确的。请看下面的截图
wfastcgi-enable 截图
<handler> scriptProcessor could not be found in <fastCGI> application configuration
下面是在wwwroot文件夹中的web.config文件中设置的值
Applied configuration changes to section "system.webServer/fastCgi" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
""c:\program files\python39\python.exe"|"c:\program files\python39\lib\site-packages\wfastcgi.py"" can now be used as a FastCGI script processor
有人可以帮助我为什么会遇到此错误。
解决方法
终于解决了问题!
问题在于 scriptProcessor 键的值。 scriptProcessor 的路径有空间,这是问题错误被抛出。
我最终不得不重新安装python,路径之间没有空格,如下所示,并且它可以正常工作。
scriptProcessor="c:\python39\python.exe|c:\python39\lib\site-
packages\wfastcgi.py"