1

I try to set up my django 2.2.2 project 'WebGUI' on IIS 10 (Windows Server 2019), but sadly I can't get it to work.

WFastCGI is installed and enabled, I created a web.config and declared a python FastCGI handler in there. the keys should be correct and as far as I know, that's all I'm supposed to configure.

the web.config:

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


 <appSettings>
  <!--Required Settings-->
  <add key="WSGI_HANDLER" value="WebGUI.wsgi.application" />
  <add key="PYTHONPATH" value="C:\inetpub\wwwroot\WebGUI" />
  <add key="WSGI_LOG" value="d:\wfastcgi.log" />
  <add key="DJANGO_SETTINGS_MODULE" value="WebGUI.settings" />

 </appSettings>
</configuration>

my settings.py says WSGI_APPLICATION = 'WebGUI.wsgi.application' and my wsgi.py:

from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'WebGUI.settings')
application = get_wsgi_application()

Error occurred while reading WSGI handler:

Traceback (most recent call last): 
File "c:\python\python37-32\lib\site-packages\wfastcgi.py",line 791, 
in main env, handler = read_wsgi_handler(response.physical_path) 
File "c:\python\python37-32\lib\site-packages\wfastcgi.py", line 633, 
in read_wsgi_handler handler = get_wsgi_handler(os.getenv("WSGI_HANDLER")) 
File "c:\python\python37-32\lib\site-packages\wfastcgi.py", line 603, 
in get_wsgi_handler handler = getattr(handler, name) AttributeError: 
module 'WebGUI' has no attribute 'wsgi' StdOut: StdErr:
Dushyant Tankariya
  • 1,432
  • 3
  • 11
  • 17
Darais
  • 11
  • 1
  • 3

1 Answers1

-1

Solved. For some reason i had a __ init__.py in my Project-Folder, which confused wfastcgi.

Darais
  • 11
  • 1
  • 3