0

I have a flask app running through IIS 10. wfastcgi loaded into app folder. app file is app.py. I cannot figure out how wfastcgi is pointing to the app.py file? I had a web.config file in the same folder. All it contained was:

<configuration>
</configuration>

I deleted that file, website still works. I do not have any other web.config files that I know of. How does wfastcgi.py know about the app.py file? If I remove the app.py file I get this web error: Error occurred while reading WSGI handler:

Traceback (most recent call last):
  File "C:\Users\Terry Phillips\Documents\ADXF\ADXF-Python\ACINT-WebServices\TACINT-WebService\wfastcgi.py", line 791, in main
    env, handler = read_wsgi_handler(response.physical_path)
  File "C:\Users\Terry Phillips\Documents\ADXF\ADXF-Python\ACINT-WebServices\TACINT-WebService\wfastcgi.py", line 633, in read_wsgi_handler
    handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
  File "C:\Users\Terry Phillips\Documents\ADXF\ADXF-Python\ACINT-WebServices\TACINT-WebService\wfastcgi.py", line 616, in get_wsgi_handler
    raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "app.app" could not be imported: Traceback (most recent call last):
  File "C:\Users\Terry Phillips\Documents\ADXF\ADXF-Python\ACINT-WebServices\TACINT-WebService\wfastcgi.py", line 600, in get_wsgi_handler
    handler = __import__(module_name, fromlist=[name_list[0][0]])
ModuleNotFoundError: No module named 'app'
Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Not a surprise as IIS hierarchical configuration system allows elements to live in upper level (such as `applicationHost.config`). Since you are using FastCGI, you can find all related settings in IIS Manager easily. – Lex Li Jun 12 '22 at 00:25
  • This link should help you: [https://learn.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis](https://learn.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis). – samwu Jun 13 '22 at 05:35

0 Answers0