简体   繁体   中英

IIS - Flask python script webconfig error wfastcgi

I am enabling flask python script with wfastcgi over IIS.

I have installed and enabled wfastCGI. However after i create a website and add webconfig file with below details -

<?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>

However I see below error while try to verify handler mapping Filename

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"

I need help to fix this, please do needfulI

IIS return this error when you are not setting configuration in root web.config or you missed to install something in IIS.

1.Please ensure C:\Users\goe\Documents\mywebsite\ is the root web.config of your web server. You need to make sure the handlers section is set in the root web.config of your web application.

2.Please ensure

<section name="handlers" overrideModeDefault="Allow" />

3.Please go to configuration manager system.webServer/handlers and check whether section has been unlocked.

4.Please ensure IIS feature has been installed completely.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM