![](/img/trans.png)
[英]Flask, IIS, Python, wfastcgi Error occurred while reading WSGI handler: ImportError: cannot import name 'Flask'
[英]IIS - Flask python script webconfig error wfastcgi
我在 IIS 上使用 wfastcgi 启用 flask python 脚本。
我已经安装并启用了 wfastCGI。 但是,在我创建网站并添加带有以下详细信息的 webconfig 文件后 -
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\users\goe\appdata\local\programs\python\python38\python.exe|c:\users\goe\appdata\local\programs\python\python38\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<directoryBrowse enabled="true" />
</system.webServer>
<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="myapp.app" />
<add key="PYTHONPATH" value="D:\" />
</appSettings>
</configuration>
但是我在尝试验证处理程序映射文件名时看到以下错误
C:\Users\goe\Documents\mywebsite\webconfig Line number:7
Error : The configuration section can not be used at this path. This happens when section is locked at parent level. Locking is either bu default (overrideModeDefault="Deny"), or set explictly by a location with overrideMode="Deny" or the legacy allowOverride="false"
我需要帮助来解决这个问题,请做必要的我
当您未在根 web.config 中设置配置或您错过在 IIS 中安装某些内容时,IIS 会返回此错误。
1.请确保 C:\Users\goe\Documents\mywebsite\ 是您的 web 服务器的根 web.config。 您需要确保在 web 应用程序的根 web.config 中设置了处理程序部分。
2.请确保
<section name="handlers" overrideModeDefault="Allow" />
3.请go到配置管理器system.webServer/handlers查看是否部分已解锁。
4.请确保 IIS 功能已完全安装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.