在Windows Server 2016上安装了python 3.8.1,django 3.0.3,wfastcgi和iam收到此错误,找不到任何修复它的东西。在python安装文件夹上给了IIS AppPool\DefaultAppPool读取和使用权限,但它仍然不起作用,不知何故处理程序无法读取它,但据我所知,配置似乎是正确的。希望你能帮助我。谢谢。C:\inetpub\wwwroot -> web.conf<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <handlers> <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\users\administrator\python38\python.exe|c:\users\administrator\python38\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" /> </handlers> </system.webServer> <appSettings> <!-- Required settings --> <add key="WSGI_HANDLER" value="web.wsgi.application" /> <add key="PYTHONPATH" value="C:\inetpub\wwwroot\AddressLizenzbuch" /> <!-- Optional settings --> <add key="DJANGO_SETTINGS_MODULE" value="web.settings" /> </appSettings></configuration>C:\inetpub\wwwroot\AddressLizenzbuch\web\blog\static -> web.config<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <!-- Overrides the FastCGI handler to let IIS serve the static files --> <handlers> <clear/> <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" /> </handlers> </system.webServer></configuration>manage.py#!/usr/bin/env python"""Django's command-line utility for administrative tasks."""import osimport sys
1 回答
精慕HU
TA贡献1845条经验 获得超8个赞
这应该是一个简单的解决方法。你的 Django 项目是以下结构
C:/inetpub/wwwroot/AddressLizenzbuch/web/web跟。web.config
问题是额外的目录 。删除它。AddressLizenzbuch

您的目录应类似于 。C:/inetpub/wwwroot/web/web
问题是 wfastcgi.py 正在寻找,但这条路显然不存在。您的配置文件应在删除非必要目录后包含此行C:/inetpub/wwwroot/AddressLizenzbuch/web/wsgi.pyAddressLizenzbuch
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\web" />
为了明确这一点,您的 wsgi.py 文件应位于C:\inetpub\wwwroot\web\web\wsgi.py
如果您还有其他问题,请随时在GitHub上浏览此项目webproject
添加回答
举报
0/150
提交
取消
