简体   繁体   English

如何在wfastcgi中修复“ AttributeError:模块没有属性'wsgi'”

[英]How to fix “AttributeError: module has no attribute 'wsgi' ” in wfastcgi

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. 我尝试在IIS 10 (Windows Server 2019)上设置django 2.2.2项目'WebGUI',但可惜我无法使其正常工作。

WFastCGI is installed and enabled, I created a web.config and declared a python FastCGI handler in there. WFastCGI已安装并启用,我创建了一个web.config并在其中声明了python FastCGI处理程序。 the keys should be correct and as far as I know, that's all I'm supposed to configure. 键应该是正确的,据我所知,这就是我应该配置的全部。

the web.config: 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 : 我的settings.py说WSGI_APPLICATION = 'WebGUI.wsgi.application'和我的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: 读取WSGI处理程序时发生错误:

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:

Solved. 解决了。 For some reason i had a __ init__.py in my Project-Folder, which confused wfastcgi. 由于某种原因,我在Project-Folder中有一个__ init__.py,它使wfastcgi感到困惑。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:模块“djangoschool”没有属性“wsgi” - AttributeError: module 'djangoschool' has no attribute 'wsgi' AttributeError:模块 'wsgi' 没有属性 'application' - AttributeError: module 'wsgi' has no attribute 'application' 如何修复 AttributeError: &#39;module&#39; 对象没有属性 &#39;function&#39;? - How to fix AttributeError: 'module' object has no attribute 'function'? 如何修复“AttributeError:‘module’对象没有属性‘x’”? - how to fix "AttributeError: 'module' object has no attribute 'x' "? 如何修复AttributeError:模块&#39;testing2&#39;没有属性&#39;printPackage&#39;? - How to fix AttributeError: module 'testing2' has no attribute 'printPackage'? 如何修复:AttributeError:模块“整洁”没有属性“配置” - How to fix: AttributeError: module 'neat' has no attribute 'config' 如何修复 AttributeError:模块“tensorflow”没有属性“ConfigProto” - How can I fix AttributeError: module 'tensorflow' has no attribute 'ConfigProto' 如何修复 AttributeError:模块“requests.sessions”没有属性“post” - How to Fix AttributeError: module 'requests.sessions' has no attribute 'post' 如何修复此错误“AttributeError:模块‘socket’没有属性‘gethostname’” - How to fix this error "AttributeError: module 'socket' has no attribute 'gethostname'" 如何修复 AttributeError:模块“magpylib”没有属性“源” - How to Fix AttributeError: module 'magpylib" has no attribute 'source'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM