首页 > 解决方案 > Django - IIS 部署 - 找不到 scriptProcessor

问题描述

我一直在尝试使用 IIS 部署 django 应用程序,但是在执行了所有步骤之后,我遇到了错误

<handler> scriptProcessor could not be found in <fastCGI> application configuration

我知道这个错误是由于 scriptprocessor 值的路径不正确,但提到的值是正确的。请看下面的截图

wfastcgi-enable 的截图

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

以下是 wwwroot 文件夹中 web.config 文件中设置的值

<handlers>
  <add name="Python FastCGI" 
  path="*" 
  verb="*" 
  modules="FastCgiModule" 
  scriptProcessor="c:\program files\python39\python.exe|c:\program files\python39\lib\site-packages\wfastcgi.py"
  resourceType="Unspecified" 
  requireAccess="Script" />
</handlers>

有人可以帮助我为什么面临这个错误。

标签: djangoiiswfastcgiiis-handlers

解决方案


终于解决了问题!

问题在于scriptProcessor键的值。scriptProcessor 的路径有空间,这就是抛出的问题错误。

我终于不得不重新安装python,路径之间没有空格,如下所示,它工作正常。

scriptProcessor="c:\python39\python.exe|c:\python39\lib\site- 
packages\wfastcgi.py"

推荐阅读