[英]IIS Not Linking to Django with PyISAPIe
I'm trying to run a site with Django on an IIS-based server. 我正在尝试在基于IIS的服务器上运行Django站点。 I followed all the instructions on the main site ( http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer ), and double checked it with a very good article ( http://www.messwithsilverlight.com/2009/11/django-on-windows-server-2003-and-iis6/ ). 我按照主站点上的所有说明( http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer ),并用一篇非常好的文章仔细检查了它( http://www.messwithsilverlight.com/2009/11/django -on-windows-server-2003-and-iis6 / )。
I successfully got as far as setting up IIS to read .py files. 我成功地设置了IIS来读取.py文件。 Following the main instructions, I can get the server to render Info.py. 按照主要说明,我可以让服务器呈现Info.py. However, I can't seem to get IIS and Django to play nice. 但是,我似乎无法让IIS和Django玩得很好。 If, for instance, my Virtual directory is "abc", then if I go to "localhost/abc/", the browser simply shows me the content directory for that folder. 例如,如果我的虚拟目录是“abc”,那么如果我转到“localhost / abc /”,浏览器只会显示该文件夹的内容目录。 Furthermore, if I have my urls set up so that "/dashboard/1" should bring me to a certain page, entering "localhost/abc/dashboard/1" gives me a "page cannot be displayed" error. 此外,如果我设置了我的网址以便“/ dashboard / 1”将我带到某个页面,输入“localhost / abc / dashboard / 1”会给我一个“无法显示页面”的错误。
I'm fairly certain IIS simply isn't referencing or interacting with Django at all. 我相当确定IIS根本就没有引用Django或与Django进行交互。 Does anyone have any ideas how to fix this? 有没有人有任何想法如何解决这个问题?
Thanks 谢谢
Here are the original instructions I followed, 以下是我遵循的原始说明,
basics instructions: https://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer additional tips: http://whelkaholism.blogspot.ca/ 基础知识说明: https : //code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer其他提示: http : //whelkaholism.blogspot.ca/
web_site
\\ django_project
) and DJANGO_SETTINGS_MODULE (ie django_app
.settings) 在Isapi.py中,设置路径(即c:\\ inetpub \\ wwwroot \\ web_site
\\ django_project
)和DJANGO_SETTINGS_MODULE(即django_app
.settings) Here are some other things you might do 以下是您可能会做的其他一些事情
web_site
in our example) 在您的url和html文件中,确保路径以您为虚拟目录别名命名的名称(即我们示例中的web_site
) Finally, you may encounter difficulties with serving your CSS. 最后,您可能会遇到服务CSS的困难。 If you have any troubles, tell me and I will update my post. 如果您有任何问题,请告诉我,我会更新我的帖子。
Serving Django with any webserver basically involves three key details: 使用任何网络服务器提供Django基本上涉及三个关键细节:
If you're getting a directory listing back for your Virtual Directory then it would seem that you should investigate the VD settings to make sure PyISAPIe is configured for that directory (key details #1). 如果您正在为虚拟目录获取目录列表,那么您似乎应该调查VD设置以确保为该目录配置PyISAPIe(关键详细信息#1)。
From the article you mentioned: 从你提到的文章:
Open the IIS Management Console, and create a new virtual directory, and allow executing ISAPI extensions when prompted by the wizard. 打开IIS管理控制台,并创建一个新的虚拟目录,并在向导提示时允许执行ISAPI扩展。
View the properties of the new folder and click on the "configuration" button (if it's greyed out, click 'create' first), then add a new wildcard extension (the lower box), locate the pyisapie.dll file and untick the "check that file exists" box. 查看新文件夹的属性,然后单击“配置”按钮(如果它显示为灰色,先单击“创建”),然后添加新的通配符扩展名(下方框),找到pyisapie.dll文件并取消勾选“检查该文件是否存在“框。
In the IIS Manager, go to the "Web Service Extensions" section, and right click -> add new web service extension. 在IIS管理器中,转到“Web服务扩展”部分,然后右键单击 - >添加新的Web服务扩展。
Give it a name (it doesn't matter what), add the pyisapie.dll fill as a required file and check the box to set the extension status to allowed. 给它命名(无关紧要),将pyisapie.dll填充添加为必需文件,并选中复选框以将扩展状态设置为允许。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.