« Discarded WSGI wrappersThe new VAIO must-have accessory »

RESTful re-treat

05/09/05

Permalink 04:25:31 pm, by fumanchu Email , 370 words   English (US)
Categories: IT, Cation

RESTful re-treat

I've been looking around recently at Python web frameworks (again). But I keep remembering the reasons why I wrote Cation in the first place:

  1. When all of your users access network files using a Windows network password, it's very nice to be able to use the same password for a web application—this means using IIS on the server side in its "Integrated Windows authentication" mode. Using IIS means rejecting the vast majority of all existing web frameworks.
  2. A persistent server process is a Good Thing, so "dumb" CGI is right out.
  3. Pure ISAPI handlers for IIS generally suck, due mostly to requiring the deployer(!) to compile a DLL, or costs which I-as-framework-developer don't wish to foist upon others.
  4. ...which leaves ASP. Fortunately, Python can be used as an ASP language. Unfortunately, IIS/ASP has no built-in URL rewriting, so you need a separate .asp file for each URL you expect to serve.

I've been re-examining that set of assumptions lately, because I want to develop more RESTful representations of our data. Many of my current web forms suck, because they pull large sets of data in the interest of not-reloading-the-page. The prevalence of XMLHttpRequest is leading me to investigate alternatives.

The problem with a more-RESTful approach is that I'm currently stuck with the side-effects of #4, above; each URL needs a separate .asp file. So, if I want to publish the URL /app/directory/45987, I've got to create a file named /app/directory/45987! This is Not Good. In addition, I don't think I can serve a resource without a file extension (like ".asp"), but don't quote me on that one.

Therefore, it looks like the choices are:

  1. Ditch IIS and work solely with Apache. This may make some users mad when they get passwords out of sync. But it would mean I could drop my web framework completely and develop a REST+JSON plugin for an existing, major Python framework.

  2. Bite the bullet and use ISAPI rewriting. I found a simple ISAPI rewriter today: ISAPI_Rewrite, which has a freeware "Lite" version.

Tough choices like this make me pine for my own personal hypnotoad.

5 comments

Comment from: Titus Brown [Visitor] · http://www.idyll.org/

Have you seen this?

http://isapi_wsgi.python-hosting.com/

05/09/05 @ 17:54
Comment from: fumanchu [Member] Email

No, I hadn't; thanks! I'll definitely have a look--having more than one option in that layer makes me feel a whole lot better about abstracting it away. ;)

05/09/05 @ 20:05
Comment from: fumanchu [Member] Email

Okay, after an hour or so of analysis, I think I'm going to have to pass on isapi_wsgi, because there isn't a multithreaded version yet, and I don't feel like writing one. AFAICT, such a beast would have to attach a separate WSGI BaseHandler to each WorkerThread (in ISAPIThreadedPoolExtension.workers).

It seems BaseHandler itself has no provision for multithreaded servers at all... are there any multithreaded WSGI servers/wrappers which are being maintained? Maybe when pythonpaste.org starts responding again, the webkit module will have one I can butcher...

05/09/05 @ 23:32
Comment from: Gheorghe Milas [Visitor] · http://www.emilas.com/george/

As far as I can remember you could write your own error handling script to handle url rewrites on your own.

I am using python/ASP at work almost exclusivly, however sometimes I had bugs I could not trace and it many times led me to think it may be the "ASP in python bridge" having bugs. Do you have any thoughts on that you could share with me?

Thanks.

05/27/05 @ 13:11
Comment from: fumanchu [Member] Email

Gheorghe: other than "import traceback" I'm afraid I don't have too many hints. My ASP pages are never longer than 3 lines of Python, just enough to call a real framework. :)

05/27/05 @ 13:27

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.

Please enter the phrase "I am a real human." in the textbox above.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
October 2018
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Search

The requested Blog doesn't exist any more!

XML Feeds

blog tool