FastCGI进程经常失败,在使用IIS在Windows 2012服务器上部署Django应用程序时出现错误

问题描述 投票:5回答:1

[enter image description here我正在尝试使用IIS在Windows 2012服务器上部署Django应用程序。我的web.config文件:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>

            <add name="Django Handler" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Users\chinmay_arima\env_resolution\Scripts\python.exe|C:\Users\chinmay_arima\env_resolution\Lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />

    </handlers>
    </system.webServer>
</configuration>

获取“ HTTP错误500-内部服务器错误”。请找到附件以查看错误。使用Django版本:2和IIS版本:8.5我关注以下链接:http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html请帮帮我,我需要使用IIS服务器在Windows上部署Django应用程序。

django fastcgi iis-8 django-deployment windows2012rc
1个回答
0
投票

有点晚,但我认为此错误是由web.config文件的位置错误引起的。另外,appSettings

下似乎缺少一些参数

您的配置文件应类似于https://github.com/Johnnyboycurtis/webproject/blob/master/web-config-template

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
    <handlers>
    <add name="Python FastCGI" 
    path="*" 
    verb="*" 
    modules="FastCgiModule" 
    scriptProcessor="<to be filled in>" 
    resourceType="Unspecified" 
    requireAccess="Script" />
    </handlers>
</system.webServer>

<appSettings>
    <add key="PYTHONPATH" value="C:\inetpub\wwwroot\webproject" />
    <add key="WSGI_HANDLER" value="webproject.wsgi.application" />
    <add key="DJANGO_SETTINGS_MODULE" value="webproject.settings" />
</appSettings>
</configuration>

这里是与该代码项目Deploy Django on Windows using Microsoft IIS 一起学习的教程>

© www.soinside.com 2019 - 2024. All rights reserved.