简体   繁体   English

在IIS上设置Django

[英]Setting up Django on IIS

I have been trying to setup Django to work on IIS 7 Enterprise (Version 6.1 on Windows 7), but so far have been unable to. 我一直在尝试将Django设置为可在IIS 7 Enterprise(Windows 7上的6.1版)上工作,但到目前为止无法这样做。 I am using Django 1.8.3 and Python 2.7. 我正在使用Django 1.8.3和Python 2.7。 I am using PyISAPI to run Django on IIS. 我正在使用PyISAPI在IIS上运行Django。 I have tried both the 2.6 version of PyISAPI and the 2.7 version ( http://blog.wolfplusplus.com/?attachment_id=276 ). 我已经尝试了2.6版本的PyISAPI和2.7版本( http://blog.wolfplusplus.com/?attachment_id=276 )。 I have followed the following tutorials: 我遵循了以下教程:

IIS Not Linking to Django with PyISAPIe IIS无法使用PyISAPIe链接到Django

http://blog.wolfplusplus.com/?p=272 http://blog.wolfplusplus.com/?p=272

I have followed others also, and all of them do slightly different things. 我也跟随其他人,他们都做些不同的事情。 None of them have worked with me so far, and all of the tutorials seems to be a couple of years old. 到目前为止,他们还没有与我合作,而且所有教程似乎都已经有两年历史了。 Can someone provide a straightforward up to date guide on how to setup Django 1.8 (running with Python 2.7) with IIS. 有人可以提供有关如何通过IIS设置Django 1.8(与Python 2.7一起运行)的直接指南。 There seems to be multiple approaches such as using FastCGI, but I have read that PyISAPI is much faster than FastCGI. 似乎有多种方法,例如使用FastCGI,但是我已经读到PyISAPI比FastCGI快得多。 My goal is to run a Django application on IIS. 我的目标是在IIS上运行Django应用程序。

I've just followed that guide with following corrections: 我刚刚按照指南进行了以下更正:

  1. You should give permission on the site folder to App Pool's identity. 您应在站点文件夹上授予App Pool身份的权限。 I just went to App Pool's Advanced Settings > Process model > Identity and set it to local admin account for testing purposes. 我刚刚进入App Pool的“高级设置”>“流程模型”>“身份”,并将其设置为本地管理员帐户以进行测试。
  2. Correct environment variable name in step 4.13 is DJANGO_SETTINGS_MODULE , underscores were eaten by markup 步骤4.13中正确的环境变量名称为DJANGO_SETTINGS_MODULE ,下划线已被标记DJANGO_SETTINGS_MODULE

and everything worked fine! 一切正常! If it's not applicable in your case please provide some additional details. 如果不适用于您的情况,请提供一些其他详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM