Really confused about wfastcgi and IIS

Sep 8, 2014 at 6:13 PM
Edited Sep 8, 2014 at 7:16 PM
I've completely hit a brick wall, and don't seem to understand how to integrate wfastcgi and IIS. On my development server, I've successfully deployed a test Django application on IIS, including loading of static resources as defined in the static settings, except for one critical item. Subpath urls return the IIS 404 page.

That is, /test2/ works, returning my html template as expected. /test2/page1/, though, does NOT work, returning the IIS 404. Since it's the IIS 404, not the django 404, I know it found the path in the urls. Obviously, I'm not understanding something about IIS and how it relates to wfastcgi?

I'm guessing it's the path in the handler, of which I have one configured for the web site, shown from the web.config below
<modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <clear/>
      <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Virtual\Django16\Scripts\python.exe|C:\Python27\Scripts\wfastcgi.py" resourceType="Either" requireAccess="Script" />
    </handlers>
Also shown is my test2 urlconf
from django.conf.urls import patterns, include, url

urlpatterns = patterns('',
    url(r'^$', 'test2.views.index', name='index'),
    url(r'^page1/$', 'test2.views.page_1', name='page_1'),
)
My understanding is the "*" path wildcard is to handle anything not handled by other handlers, which is why we add the <clear/> to the handlers section for the website, so the ONLY handler is my wfastcgi handler. What am I missing? Why are my subpaths returning 404? Thanks all.

EDIT:
Now I'm really confused. I saw in a few places online, including the wfastcgi documentation, where a rewrite rule for a handler.fcgi file (or similar) was used. I copied the basics and set up my web.config handler path as handler.config and rewrite the urls as shown in the documentation, and everything is now working. I don't understand. How can the top level urls work without a handler.fcgi but not the lower levels, and more importantly, I thought wfastcgi WAS the glue code I needed between FastCGI and WSGI.

Since Django has deprecated FastCGI support due to flup no longer being supported, what is my best option moving forward? Keeping flup installed on my server and copying the fastcgi bridge code from Django? Please help. Thanks.