· 6 min read

Django, PostgreSQL, and Autocommit

In part 1, we ran down a list of the standard Django features for controlling transactions. Now, we’re going to look at some ways to optimize how these tranactions happen.

Let’s look at the SQL that our create_order() view function generated, with the transaction middleware turned on, and no transaction decorators on the function:

1

5 comments

· 4 min read

Django, PostgreSQL, and Transaction Management

Django has quite a bit of code in it devoted to transaction management. Although the documentation goes into quite a bit of depth on transactions, I’ve never felt that the docs by themselves let you build a good mental model of how transactions actually work. So, I decided to approach it experimentally: Build a small Django app, and see

2 comments

· 3 min read

ORMs and Their Discontents

I love object-oriented programming. The first time I ever encountered an OO language or framework (Object Pascal and MacApp, thank you for asking), it was as if the heavens opened. It simply made sense to me as a way of structuring programs, and I’ve been wedded to it ever since. (As it turns out, if you do the right paperwork,

7 comments

· 1 min read

Git vs Mercurial

No, I’m not going to write another Git vs Mercurial post that really digs into them, because… well, if you are using one or the other, it is probably for reasons that don’t have much to do with your preferences.

In strictly my opinion, for personal use, I like Mercurial. For projects that use Git, I use Git.

6 comments

· 5 min read

WordPress to Django+PostgreSQL, Part 4: Configuring Apache, Django, PostgreSQL

In the previous installment of this series (in which we’re migrating this blog from WordPress to Django and PostgreSQL), we installed Apache, Python 2.6, psycopg and mod_wsgi on the server.

A note about the pace: I’m taking this very slowly, spelling out each and every setp. I realize that those of you with more Centos experience (which is

0 comments

· 4 min read

WordPress to Django+PostgreSQL, Part 3: Installing Apache, Python 2.6, psycopg2, and mod_wsgi

In part 2 of this series, we got PostgreSQL up and running. In this part, we’ll install the remaining components to get Django up and running under Apache: Apache itself, Python 2.6, psycopg2, and mod_wsgi.

So far, we’ve just accepted the default configuration parameters that initdb provided. Those will get us up and running, and setting

12 comments

· 3 min read

WordPress to Django+PostgreSQL: Part 2, Configuring PostgreSQL

In part 1, we installed PostgreSQL on the VPS. In this part, it’s time to get the database server up and configured.

First, though, now that we have something to lose on the server, backups are now enabled at Slicehost. $5/month is cheap insurance. This also means we can take a snapshot of the slice, which we’ll

1 comment

· 1 min read

The Mighty GUCS: A guide to the essential PostgreSQL settings you need to know

The archive video for the October 13, 2009 SFPUG meeting is now available:

For downloading, the direct link is here, and it is also available on Vimeo if that’s more your thing.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

3 comments

· 2 min read

WordPress to Django+PostgreSQL: Part 1, Installing PostgreSQL

This is part 1 of my migration of my blog from WordPress to Django and PostgreSQL. I’m starting with a bare Centos 5.3 slice from Slicehost, and setting it up bit by bit.

In this part, I’m installing PostgreSQL.

First, an idiosyncrasy warning: I very much prefer building PostgreSQL from source, even on package-based systems like

3 comments

· 1 min read

WordPress to Django+PostgreSQL: Introduction

I’ve been doing a lot more development with Django and PostgreSQL lately. The logical thing to do is to blog about it, of course…

On my blog running WordPress?

Well, that won’t do at all.

So, I’m going to be migrating this blog to use Django and PostgreSQL, and will blog about the adventure here. I’ll

1 comment