I am having some issues with the Django deployment on IIS. I followed the guide
with few differences when setting the handler path:
<?xml version="1.0" encoding="UTF-8"?>
<add key="WSGI_HANDLER" value="django.core.handlers.wsgi.WSGIHandler()" />
<add key="DJANGO_SETTINGS_MODULE" value="helloworld0.settings" />
<!-- <add key="PYTHONPATH" value="X:\Web\mywebsite\" /> -->
<add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\dev\python\python.exe|C:\dev\python\Scripts\wfastcgi.py" resourceType="Either" requireAccess="Script" />
<rule name="Django mapping" stopProcessing="true">
<match url=".*" />
<action type="Rewrite" url="/" appendQueryString="false" />
In particular the mapping "handler.fcgi" does not work for me (I have * instead). The problem I am facing now is that I cannot retrieve the static files from the server. For instance I can see the HTML response from Django for
http://localhost:8080/admin/, but not the associated CSS files
. E.g. /static/admin/css/base.css
Page not found (404)
Request Method: GET
Request URL: http://localhost:8080/static/admin/css/base.css
Using the URLconf defined in helloworld0.urls, Django tried these URL patterns, in this order:
The current URL, static/admin/css/base.css, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
I created a folder /static/ and executed manage.py collectstatic as described in
However I do not understand how to perform the mapping for the static files in IIS. I tried to create a virtual folder and virtual application in IIS, or even changed the reg exp to exclude /static/, still the request is processed by Django, which returns the
The application works fine with the Django embedded server.
Any hint ? :)