profile
viewpoint

Ask questionswfastcgi3.0.0 + django 2.1.8 + IIS, WSGI_HANDLER not set

I followed the instructions exactly on the microsoft docs, as well as some youtube videos. Here is my error and my config

Error occurred while reading WSGI handler:

Traceback (most recent call last):
  File "c:\python\lib\site-packages\wfastcgi.py", line 791, in main
    env, handler = read_wsgi_handler(response.physical_path)
  File "c:\python\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
    handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
  File "c:\python\lib\site-packages\wfastcgi.py", line 586, in get_wsgi_handler
    raise Exception('WSGI_HANDLER env var must be set')
Exception: WSGI_HANDLER env var must be set


StdOut: 

StdErr: 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\python\python.exe|c:\python\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
    </handlers>
    <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true" />
  </system.webServer>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" />
  </system.web>
  <appSettings>
      <add key="PYTHONPATH" value="c:\inetpub\wwwroot\project" />
      <add key="WSGI_HANDLER" value="project.wsgi.application" />
      <add key="DJANGO_SETTINGS_MODULE" value="project.settings" />
  </appSettings>
</configuration>
microsoft/PTVS

Answer questions huguesv

There's nothing that jumps out as being wrong, it's the first time I see a report of that particular error. There may be something about the IIS configuration that is not applying those keys as environment variables? I remember reading about some people have permissions not set correctly that affected usage of wfastcgi, but I'm searching online and not finding it anymore.

useful!
source:https://uonfu.com/
Github User Rank List