为了账号安全,请及时绑定邮箱和手机立即绑定

django on IIS winserver 2016 wfastcgi handler

django on IIS winserver 2016 wfastcgi handler

万千封印 2022-08-16 18:18:27
在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

//img1.sycdn.imooc.com//62fb6f230001501b04980176.jpg

您的目录应类似于 。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


查看完整回答
反对 回复 2022-08-16
  • 1 回答
  • 0 关注
  • 204 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号