所以我尝试执行 Http Platform Handler,但现在当我访问 localhost 时,我处于无限加载屏幕中。
这是我的配置文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="C:\Python310\python.exe"
arguments="C:\inetpub\Comsroomform\Home manage.py runserver --port 80"
stdoutLogEnabled="true"
stdoutLogFile="c:\home\LogFiles\python.log"
startupTimeLimit="60"
processesPerApplication="16">
<environmentVariables>
<environmentVariable name="SERVER_PORT" value="80" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
我被告知要遵循本教程:https://halfblood.pro/running-flask-web-apps-on-iis-with-httpplatformhandler/
是时候回来回答了。
Django 使用一组不同的命令行选项,因此您需要类似的东西
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\python.log" startupTimeLimit="20" processPath="C:\Users\<user name>\AppData\Local\Programs\Python\Python310\python.exe" arguments=".\mysite\manage.py runserver %HTTP_PLATFORM_PORT%">
</httpPlatform>
</system.webServer>
</configuration>
更多详细信息和尝试步骤可以在我的博客文章中找到。
https://docs.lextudio.com/blog/running-django-web-apps-on-iis-with-httpplatformhandler/