I'm trying to run a site with Django on an IIS-based server. 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/ ).
I successfully got as far as setting up IIS to read .py files. Following the main instructions, I can get the server to render Info.py. However, I can't seem to get IIS and Django to play nice. 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. 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.
I'm fairly certain IIS simply isn't referencing or interacting with Django at all. 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/
web_site
\\ django_project
) and DJANGO_SETTINGS_MODULE (ie django_app
.settings) Here are some other things you might do
web_site
in our example) Finally, you may encounter difficulties with serving your CSS. If you have any troubles, tell me and I will update my post.
Serving Django with any webserver basically involves three key details:
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).
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.
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.
In the IIS Manager, go to the "Web Service Extensions" section, and right click -> add new web service extension.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.