Today, Christophe Pettus wrote about an easy way to get better database performance from a ForeignKey reference. Don't do: pub_id = b.publisher.id Do do: pub_id = b.publisher_id After you read his post, you'll think, "But of course!" Joe Bob says check it out.
Tag: Django
Celery uses spin-loops. Gah!
Here's another cautionary performance tale. If you use Celery subtasks to manage parallel work, know going in that it uses spin-loops to monitor subtask progress. Specifically, if you get a TaskSetResult from a TaskSet and then use iterate() or join(), the underlying code will eat your CPU alive. Here's the code in celery.result.TaskSetResult: The symptom … Continue reading Celery uses spin-loops. Gah!
A performance lesson on Django QuerySets
At work, we've contracted with PostgreSQL Experts to help us improve our Postgres performance. After analyzing our system, one of their consultants, Christophe Pettus, found glaring problems in how some of my code accessed our database. I consider myself well-informed about good database access practices in Django, and in general. I might not exactly hit … Continue reading A performance lesson on Django QuerySets
Multiple cache backends in Django
Out of the box, Django's cache framework includes different cache back-ends (including the venerable memcached) and granularities (site-wide, view-specific, etc.). How could you improve on this awesomeness? One way is to use multiple back-ends. This might be desirable if your application needs a vanilla-flavored memcache for the site, and a second cache for a data … Continue reading Multiple cache backends in Django
Review: Django 1.2 e-commerce
I already have Beginning Django E-Commerce. When Django 1.2 e-commerce came out, I thought, sure, why not. I'm a pushover for a good technical book. It has positive buzz, modulo some rumblings about glaring errors in the code samples. The quick details Chapter 1: What's Django and why it's good for e-commerce. Zzzzzzzz... Chapter 2: Quickly … Continue reading Review: Django 1.2 e-commerce
Postgres site will migrate to Django
One interesting tidbit from last night's PostgreSQL BOF session was the news that Postgres' site would be migrated to Django within the next year. This came from Josh Berkus. Postgres' site now is apparently generated from a bespoke PHP script mishmash. Josh said that tasks like creating new forms was much harder than they ought to … Continue reading Postgres site will migrate to Django
The Mess Django’s In?
In the Mock It! blog, Malthe Borch writes that Django's innards are a disaster. The comments are as good as the article. Money quote: [If you] take a peek under the hood, your impression of Django will change dramatically: The code is awful. [Django's] got a terrific story if you're willing to drink the kool-aid … Continue reading The Mess Django’s In?
Seattle Django Users’ group
A Seattle Django Users' group is forming. Here's the official announcement: ------ Forwarded Message From: Brian Gershon Reply-To: A group of Python users in Seattle Date: Mon, 4 May 2009 13:57:35 -0700 To: seattle-python, plone_seattle Subject: New Seattle Django User Group meeting June 2 (Save the Date) This is an invite for the newly forming … Continue reading Seattle Django Users’ group
Django -> Plone: Portlets, Viewlets, Zcatalog, Aspects
[Another in a series of posts about moving from Django to Plone. I'm a Plone/Zope newbie writing about my bafflements and enlightenments as they happen. Some of my opinions are certainly wrong. I'm writing this in the expectation that the history of my meandering learning path may be useful, or at least entertaining, to future Plone … Continue reading Django -> Plone: Portlets, Viewlets, Zcatalog, Aspects
Django -> Plone: Light Bulbs, differences, irks
[This continues from my first post about my Django-to-Plone odyssey.] I now understand more of Plone's underlying concepts. I can't yet create a non-trivial Plone site from scratch in a reasonable amount of time, but I'm getting closer. I've read some of, and have temporarily put aside, Professional Plone Development. I've read a few of the on-line tutorials … Continue reading Django -> Plone: Light Bulbs, differences, irks
