Django Talk Correction

So I've been more than a little sleep deprived lately and apparently have lost the ability to keep track of what the date is.  In my last post I mention that I would be giving a talk tonight about Django at the MHVLUG meeting.  In reality however the MHVLUG meeting isn't until next Wednesday (11/7/07), accordingly my talk isn't till next week.

If your interested in getting an intro to Django and meeting up with at least one person (possibly more) who develop web apps with Django, stop by the MHVLUG meeting next Wednesday, November 7 at 6 PM in the MHVLS Auditorium!  Check back soon for copies of all my presentation materials.

Installing Django on OS X 10.5 (Leopard)

This is a quick update to my previous installing django posts.

Today I got my hands on Leopard, so far I've been happy but went I went about reinstalling Django I hit a snag.  MacPort would encounter an error whenever it tried to build PostgreSQL.  If you can wait a little while the port maintainer for PostgreSQL should fix the problem.

On the other hand if you need Django running today you can follow the steps at Lee Packham's Corner to get PostgreSQL running.  Unfortunately this will get you PostgreSQL 8.2 (not inherently a bad thing) which means you will need to manually build and install psycopg2 since the MacPorts psycopg2 package depends on PostgreSQL 8.1.  Here's what you will need to do to manually build and install pyscopg2:

  • Download the source from

  • Extract the files using the command tar -xzf psycopg2-latest.tar.gz.

  • Open the file setup.cfg file and look for the line that starts with pg_config=

  • Change the line to read pg_config=/opt/local/var/macports/software/postgresql82/8.2.5_0+darwin_9/opt/local/lib/postgresql82/bin/pg_config

  • Run the command python build

  • Run the command python install

Now you should be all set!

On a related note if your interested in learning about Djago and you'll be around Poughkeepsie, NY this Wednesday stop by at the MHVLUG meeting, I'll be giving a Intro to Django talk.

Large Scale Custom and Transactional Email

As anybody who's run a website which sends any more than a trivial amount of email can attest it is incredibly difficult to ensure that the email you send is actually received by your users.  In our modern world where an estimated 80% of email is spam ISPs and email hosting providers are using increasingly complex and restrictive techniques to filter the messages coming across their servers.  This makes it very easy for your legitimate emails to get mislabeled as junk or to get your server(s) blocked.  If this didn't make things hard enough it is increasingly important to make each email one sends highly customized for each user to increase value for users and increase the likelihood that a user will actually click on a link in the email.  This requires a massive amount of infrastructure and can make optimizing emails to avoid the spam filters that much harder.  So what is one to do?

VPS Hosting

While not technically part of web development, hosting is a major part of any website.  A good host can help you through the roughest of times and help grow your site while a bad host can cause tremendous amounts of pain and suffering.  Similarly selecting the right type of hosting can give you the flexibility you need to accomplish your goals while the wrong type of hosting can leave you stuck in a corner or with an empty wallet.  Today I'm going to talk about one particular type of web hosting many people should consider, Virtual Private Server or VPS hosting.

Installing and Running Django on a Mac - Part 2 - Install

This is a continuation of Part 1 - Getting Ready.

Let's just get into it.  Before you can run Django you will need to install several dependencies.  To do this I'm using MacPorts but it can be done just as easily using PortAuthority.  In PortAuthority just search for the package name, select the package in the results and click on the install button (the brown box thing).  With MacPorts open a terminal and run the command sudo port package_name.  Be aware that each of these will take a while to run while MacPorts downloads and compiles each package and its dependencies.

  • python25 - Python 2.5 (Django will run on any version of Python 2.3 or newer, I personally like 2.5)

  • openssl - Handles encryption between python and the database server.

  • py25-setuptools - Setup tools for Python 2.5

  • postgresql81 postgresql81-server - My database of choice.  Obviously install the database that makes sense for you.

  • py-psycopg2 - Python interface for postgres.  Additionally py-psycopg2 will install two dependencies, PortAuthority/MacPorts will take care of

  • subversion - Django doesn't need SVN to run but SVN is the easiest way to get the latest version of Django.

Installing and Running Django on a Mac - Part 1 - Getting Ready

I'm a recent Mac convert.  For the most part I've loved all the perks of being a Mac user but I've run into a road block recently.  Apparently getting my favorite web application framework, Django and its various dependencies running on OS X to do local development is not as easy or clear as it is on other platforms like windows or linux.  This may be thanks to my limited knowledge of BSD's querks or simply that not many people run Django on the Mac.  To make things even more complicated I want to run the NewFormsAdmin branch instead of the current 0.96 release.  Since I'm sure I'm not the only person running into troubles and confusion with this here's a step-by-step guide on how to get Django running on your Mac!

  • Install Xcode - You will need the tools included in Xcode to build and install many of Django's Pre-requisites.  To get Xcode you can either install it from your OS X install DVD or you can download it from Apple Developer Connection (ADC).  If you choose to download Xcode be aware that you will need to register (for free) and that the download is a little under 1 GB in size.  Otherwise if you install from DVD remember to run Software Update (System Prefrences > System > Software Update), there have been several updates to Xcode since its release.

  • Download and install MacPorts - What's MacPorts you ask?  MacPorts is a package mananagement tool that handles obtaining, building, and installing dozens of open source applications and tools onto a Mac.  Once you download MacPorts mount the DMG image and run the installer package.  Generally accepting the defaults for the installer is fine.  Once installation you will have a new command available in your terminal called port.

  • (Optional) Download and install PortAuthority - PortAuthority is a GUI frontend to MacPorts.  I love the command-line but sometimes for things like package managers a GUI can be nice to more easily search and browse around.  NOTE - PortAuthority costs $20 but offers a 30 day trial.

At this point you have all the resources you will need to install Django and it's dependencies.   Check back tomorrow to see how to do the actual install.