I have done this quite a few times in the past, but not recently. I was given three days to convert an existing postgres database (front ended with Zope) to Django 1.3. I thought it would be useful to document what I did here for my own future reference and to record any gotchas for posterity. The database I am converting is nine years old, so plenty of cruft through the years, although the basic structure is sound.
Note that the website of this application is not particularly complicated. Most of the core work of this application is done via backend processes written with Twisted. The front end is used for displaying the system status and allowing for data to be modified, with a few additional complications. The system will work without any web front end (although this is hardly ideal) without stopping production, so the risk is minimised.
This is the first day – although I only started from the beginning of the afternoon, so it’s the first half a day.
I installed PostgreSQL on my new MacBook Air today via Homebrew. Having installed it I was mystified why I could not connect without specifically specifying the host was localhost. e.g.
yes:postgres ian$ psql --list
psql: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket \
Instead I would have to specify “psql –host=localhost –list”.
Turns out that 10.7 has postgres installed by default (or at least bits of it), but not configured to run. The postgres commands that you type are picked up by the default install as they are first on the path (they are in /usr/bin/, whereas the Homebrew binaries appear in /usr/local/bin/). This posting has more info.
I have changed my previous solution (moving the postgres files out of /usr/bin), which was stupid (and will give similar issues with other Homebrew installs. The correct solution is to amend ~/.bash_profile (create if it doesn’t exist) and add the following line:
Start a new terminal and you should be good to go.
I came across an irritating issue on my Windows 7 machine. Something would keep tacking focus from me. As I spend a lot of time in a full screen Ubuntu virtual machine under VMWare, this was amazingly annoying but I just couldn’t track it down.
Eventually a suggestion from Simon Bisson that iTunes had a reputation for doing such things put me on the right track. I don’t have iTunes on Windows but I did have the Apple Software Updater and QuickTime installed. I removed both of them and so far the issue has not returned in the last couple of days.
Let’s hope this is not a false dawn.
I have been trying to streamline my python development processes over the years. Earlier this year @rossjones introduced me to virtualenvwrapper which made things even simpler. I’m about to go into quite a concentrated period of development so I thought I’d take the opportunity to document what I do to make an easily reproduceable python environment. Please let me know of any errors or suggestions for better ways of doing this as I go along.
Note, I have just noticed this is not working on OS X Lion. Looking now at why. 20110816 17:28 BST
Looking for a code hilighter to use with WordPress for the blog. Ended up testing CodeColorer, here’s a test page demonstrating how it looks.
This is what I do to get WordPress running on both Ubuntu 11.04 and the current CrunchBang Statler. This is just for getting development environments running quickly, don’t follow this blindly if you’re setting up a live public facing server.