[Python] Error occurred while reading WSGI handler: Error

Discussão em 'Python' iniciado por Stack, Agosto 7, 2025.

  1. Stack

    Stack Membro Participativo

    when I want to open the django project, I encounter such an error. My django projects are live on the same server, but I encountered such an error on the last site I opened.

    web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <handlers>
    <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\python39\python.exe|c:\python39\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
    </handlers>
    <tracing>
    <traceFailedRequests>
    <clear />
    </traceFailedRequests>
    </tracing>
    </system.webServer>
    <appSettings>
    <add key="WSGI_HANDLER" value="umy.wsgi.application" />
    <add key="DJANGO_SETTINGS_MODULE" value="umy.settings" />
    <add key="PYTHONPATH" value="C:\Inetpub\vhosts\domain.com\httpdocs" />
    </appSettings>
    <system.web>
    <compilation tempDirectory="C:\Inetpub\vhosts\domain.com\tmp" />
    </system.web>
    </configuration>


    The error I get is about;

    Error occurred while reading WSGI handler:

    Traceback (most recent call last):
    File "c:\python39\lib\site-packages\wfastcgi.py", line 791, in main
    env, handler = read_wsgi_handler(response.physical_path)
    File "c:\python39\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
    handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
    File "c:\python39\lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler
    raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
    ValueError: "umy.wsgi.application" could not be imported: Traceback (most recent call last):
    File "c:\python39\lib\site-packages\wfastcgi.py", line 600, in get_wsgi_handler
    handler = __import__(module_name, fromlist=[name_list[0][0]])
    File ".\umy\wsgi.py", line 9, in <module>
    application = get_wsgi_application()
    File "c:\python39\lib\site-packages\django\core\wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
    File "c:\python39\lib\site-packages\django\core\handlers\wsgi.py", line 127, in __init__
    self.load_middleware()
    File "c:\python39\lib\site-packages\django\core\handlers\base.py", line 40, in load_middleware
    middleware = import_string(middleware_path)
    File "c:\python39\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
    module = import_module(module_path)
    File "c:\python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named 'htmlmin'



    StdOut:

    StdErr:


    I'm sorry for my bad english

    Continue reading...

Compartilhe esta Página