我有一个Windows Azure网站,该网站在管理控制台中安装了Python 3.4。这是web.config:

<configuration>
<appSettings>
    <add key="pythonpath" value="D:\home\site\wwwroot\mysite;D:\home\site\wwwroot\site-packages" />
    <add key="WSGI_HANDLER" value="django.core.handlers.wsgi.WSGIHandler()" />
    <add key="DJANGO_SETTINGS_MODULE" value="core.settings" />
</appSettings>
<system.webServer>
    <handlers>
        <add name="Python_FastCGI"
            path="handler.fcgi"
            verb="*"
            modules="FastCgiModule"
            scriptProcessor="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py"
            resourceType="Either"
            requireAccess="Script" />
    </handlers>
    <rewrite>
        <rules>
            <rule name="Django Application" stopProcessing="true">
                <match url="(.*)" ignoreCase="false" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>




当fastCGI配置的scriptProcessor属性设置为使用d:\ Python27时,一切工作正常,但对于d:\ Python34不起作用。我已使用python 2.7验证文件D:\ Python34 \ python.exe和D:\ Python34 \ Scripts \ wfastcgi.py实际上是否在服务器上存在。

编辑:

只是为了澄清,服务器返回

The page cannot be displayed because an internal server error has occurred.


当检查详细的日志时,它会显示一条通用的500内部服务器错误消息,将其指向FastCgiModule。

最佳答案

您的web.config看起来不错。 (但是您可能要启用appendQueryString =“ true”)。

在azure门户中启用日志记录,并在django项目中临时启用DEBUG = True。转到D:\ home \ LogFiles \,也可以查看该通用500消息的内容。

事实证明,您遇到了通用500错误,这表明您正在运行django。您还可以查看python进程是否在https://.scm.azurewebsites.net进程浏览器上运行。

09-26 15:40