Another Django Talk
Blaine finally let the cat out of the bag – I’m finally doing a Django talk for the Omaha Dynamic Language Group. If you saw my Django talk for the Omaha Python Group, this one will be similar, only with a little more background and a small comparison with Ruby on Rails. The application will be pretty much the same.
So, see you on Tuesday night! See ODLG’s site for location information!
Logging in Python
I’ve been using log4j for a long time, but never got into Python’s logging module. But last week I was sitting in a class about logging and my company’s new standard and toolset. The instructor kept giving Python as an example (as well as log4j) of a logging system that worked with our logging repository. During a break, I asked the instructor if there was a pocket of Python users in the company. Alas he said no, but he used it as an example of something that used the same logging standard as log4j and other Java logging utilities.
Later in the week, I was faced with a problem that needed to be solved with a Python script. I thought to myself, “Why not use Python’s logging?” I did, and it was good. Very good.
I could give examples, etc. on it, but I really don’t need to — the documentation is quite good by itself. But I didn’t see a concrete example on how to get the function name into the log message, so here is my example, as simple as it is:
def saveXml(xml):log = logging.getLogger("saveXml")
Introducing Heartland Stores
I’ve talked a little about the secret project a few times but now, finally, the secret is out. It’s called Heartland Stores.
Heartland Stores is not your typical yadda-yadda web store front. Actually, it’s not like that at all. Heartland Stores wants to help non-profit organizations with doing product fundraisers. It’s really very simple — instead of going door-to-door to your neighbor or taking a sheet to work, you send a link to the Heartland Stores website that has your organizations name. When someone follows that link and buys some product, your organization gets part of proceeds — a large part, in fact. The products are shipped directly to the buyer and the organization gets a check from Heartland Stores.
Sounds simple, right? Well, yeah, it is. There’s no money to gather, no product to distribute — just have people click on the link and go shopping.
And wouldn’t you know? We are finally having our first fundraiser from the folks at Lost and Found, Inc. I would like to thank them for taking a chance on an experimental way to do fundraising.
Other people can talk more about the business side of Heartland Stores. It probably doesn’t need to be mentioned that I did the technological stuff, right? So let’s talk about that . . .
The store itself is ran by Django using a shopping cart called Satchmo. I customized Satchmo a bit to do our “link to an organization”, and let Satchmo do all the payment processing, etc. The layout and the menus done with YUI. And the fine folks at Joyent are hosting us.
So that’s it — that’s the secret project. It seems like a new child has been born. But it hasn’t been easy up to here and it won’t be easy after this, either. The site will evolve, our business will evolve and our customers will, too.
Some Quick Things
Yep, it’s that time I put a bunch of random stuff together in one post. Deal with it.
- Anyone else in Omaha sick of the snow besides Gina and I? I can’t believe my backyard has been covered since December.
- Leah had a severe cough all last week. On Saturday we took her to the doctor and, sure enough, it was what we feared — pneumonia. They put her on antibiotic and it’s working okay. The cough seems better anyway.
- A couple guys have forked a long-dead Jython shell project and has given it a rebirth and have called it iJython. It’s still early, but I’ve used it and it’s very cool.
- Best Doctor Who quote ever:
Rose (to Dalak Leader): Five million Cybermen, easy. One Doctor? NOW you’re scared!
This was just after the Dalaks and Cybermen were talking smack to each other. Sheer geek goodness.
- It’s wonderful when an report an issue on a sub-project and that issue creates a lively discussion in the main project.
Spring and Jython — what a combo!
I’ve been thinking off and on for a few month that using Spring inside of Jython would be a magical thing. You could just get a Spring ApplicationContext, call “getBean” and Jython (who doesn’t care what kind of object it is) would happily go on it’s way. No importing a ton of object — just magic. Surely it’s not that easy.
Well, this weeks I finally got an opportunity to do so. I’m working on a Spring-based application and I needed to write a script to setup some test data for my stuff. So I broke Jython out and away I went. But was it that easy? Why yes — that was all I had to do!
Of course, this isn’t Jython-centric. Any of the JVM-based dynamic languages would have this. Groovy, JRuby, Beanshell . . .
I’m sure others have already done this before, but I think it’s really cool.
Powered by ScribeFire.