The Artima Developer Community
Sponsored Link

Python Buzz Forum
Some Python webapp notes

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
Victor Ng

Posts: 112
Nickname: victorng
Registered: Aug, 2003

Victor Ng programs Python for money, but he'd be programming Python anyway if he was a bum.
Some Python webapp notes Posted: Mar 24, 2004 7:37 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Victor Ng.
Original Post: Some Python webapp notes
Feed Title: Victor Ng's Weblog
Feed URL: https://blog.crankycoder.com/feed/atom/
Feed Description: Python Feed
Latest Python Buzz Posts
Latest Python Buzz Posts by Victor Ng
Latest Posts From Victor Ng's Weblog

Advertisement

We’ve been hacking away on our project at work for the last 3 weeks and things are starting to really roll now. After an initial period where we were fighting with the tools - things seem to be moving a lot more smoothly now.

Things to note when you’re working in Webware:

If you use FormKit - stay the hell away from the CompoundField unless you can help it. CompoundFields get bogged down in complexity too quickly.

Over here, we’ve ended up taking the FormKit and hacking it up into something a little simpler. Some integration was done with FormEncode to get more powerful error handling.

Webware is pretty nice, but my biggest problem with it is that I can actually crash the application server sometimes. Debugging your web application boils down to logging - lots and lots of logging. My suggestion - get your head around the logging modules in Python and roll yourself a log server and logging clients.

The sample code in the latest Python docs should be enough to get you going with some working code. Just remember to use %r when you write something in your formatting strings or else you may get an exception when a None gets passed in.

Stay the hell away from MySQL. It will cause you unnecessary pain. When you think you can ‘get away with’ using MySQL - rethink that choice 47 times and then realize that you are wrong. Just use Postgresql. There’s just no excuse not to.

Some problems we’ve had with MySQL (4.0.17):

  • popping database connections over TCP/IP
  • Bizarre errors claiming “You can’t do that now” or something to that effect

Postgresql - well we’ve yet to have a serious problem with the 7.4 series. The only slight problem is that the psycopg doesn’t seem to interoperate between Postgres 7.4 clients and 7.2 servers. I’m pretty sure this has something to do with the new error handling in pgsql 7.4, but I’m not sure.

SQLObject is your friend. I originally hacked out a persistence layer using code generation - but it didn’t pan out. More on that in another post, but the short version is - programmatic interfaces beat static code generation. If you do decide on trying out code generation - a good intro book I found was Code Generation In Action.

Related links:

Read: Some Python webapp notes

Topic: Outlined Blogroll Previous Topic   Next Topic Topic: PyCon sprints, day 2

Sponsored Links



Google
  Web Artima.com   

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