The Artima Developer Community
Sponsored Link

Python Buzz Forum
My CherryPy Rant

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
My CherryPy Rant Posted: Feb 15, 2006 10:20 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: My CherryPy Rant
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

I spent way more time than I planned or wanted to spend on CherryPaste today, mostly trying to get Catwalk to work correctly.

First, CherryPy's WSGI application doesn't use SCRIPT_NAME like it should. After getting a less than enthusiastic response on that ticket, I thought I would just not bother pursuing that and fix it myself. CherryPaste could then be seen simply as the valid-to-spec WSGI application for CherryPy. That ended up being a pain in the butt. The VirtualPathFilter recipe I built off of is just a silly hack, frankly, despite the fact that it's a likely part of any realistic deployment. The WSGI environment is thrown away, so if you planned to pass information through WSGI into the CherryPy request you can't. I haven't looked very hard, but I haven't yet found the way to turn off CherryPy's catching of exceptions (which I want because Paste has a better exception handler). CherryPy eats exceptions from some filter methods.

This all to get Catwalk to run under something besides the root path. Then I realize CatWalk has entirely hardcoded URLs. That's just silly. turbogears.view.stdvars creates dynamic values that it should be using; that was an easy enough change. Except TurboGears bases those values off something calculated at server startup, and stores it in a module global. So I have to patch in a threadlocal value that poses as a string. Lastly Catwalk patches the configuration to add static paths when you access the index page; but since I'm keeping configuration information isolated to each request that doesn't work. So I have to add a specific hack to the Catwalk entry point to fix up the configuration on each request.

In the end it all works, at least for this one case. But damn. This is not what I want to be working on. I feel like I'm just cleaning up other people's shit. I have enough shit of my own that needs cleaning up.

It's not like this is Paste-specific stuff. No one knows how to do this stuff in CherryPy. No one seems to have any authoritative answer on how you deploy these apps -- how you move between servers, how you change the application root, how you put apps together into a single server. Everything is ad hoc stuff that just barely works for one app on one server. It's all "recipes". Recipes are often just stuff that no one cares enough about to do right. This is too central to what CherryPy is supposed to be doing to be a recipe.

It occurs to me that TurboGears was extracted from an application that runs on the local machine. In that case none of these issues would have been apparent. But that's not similar to how people are actually using TG. I think these shaky underpinnings are risky for the project.

Read: My CherryPy Rant

Topic: Too Much Fun with Python on Nokia Phone Previous Topic   Next Topic Topic: TracPaste & CherryPaste

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use