我试图在django 2.2.2 (WindowsServer2019)上设置我的WebGUI项目,但遗憾的是,我无法让它开始工作。
安装并启用了WFastCGI,我在其中创建了一个web.config并声明了一个pythonFastCGI处理程序。键应该是正确的,据我所知,这是我应该配置的全部。
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>我的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()读取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:发布于 2019-07-24 11:38:05
解决了。出于某种原因,我在我的项目文件夹中有一个__ init__.py,这使wfastcgi感到困惑。
https://stackoverflow.com/questions/57163406
复制相似问题