Chad Stovern

Christian. Husband. Dad. Geek.

How to Run a Django Site with Apache, mod_wsgi, and MySQL on FreeBSD 10.1

The beauty of developing with popular web frameworks like Django is that a lot of repetitious work has been done for you, so you can focus on building your site. It's also great to know that the core of what you're running has undergone the scrutiny of a large open-source community and should be less susceptible to large security holes.

Whether you're a developer or not, one thing that is not inherently simple is knowing how to get these web frameworks up and running outside of your own development or testing environment.

I’ve written a full tutorial over at DigitalOcean covering exactly how you set this up on a FreeBSD droplet using a standard Apache, mod_wsgi, and MySQL stack running on top of FreeBSD 10.1.

Check out the full tutorial here: How to Run a Django Site with Apache, mod_wsgi, and MySQL on FreeBSD 10.1

How To Send Email through an External SMTP Service with Sendmail on FreeBSD 10.1

One of the most common needs when setting up a new web server is sending email. The safest and easiest way to do this is to connect your server to a mailing service such as SendGrid or Amazon SES. Using an external service will help you avoid pitfalls like your server IP getting blacklisted by anti-spam services.

I’ve written a full tutorial over at DigitalOcean covering exactly how you set this up on your FreeBSD droplet.

If you're new to FreeBSD, some of what we do may look a little scary, but you'll soon be comfortable rolling up your sleeves to do a little recompiling of system tools like the FreeBSD pros.

Check out the full tutorial here: How To Send Email through an External SMTP Service with Sendmail on FreeBSD 10.1

Build a $20 Standing Desk in 20 Minutes

After nearly a decade of working jobs doing geek stuff sitting in front of a computer all day, I started developing lower back pain. Even being active off hours wasn't enough, so I caved and talked my boss into a GeekDesk v3.

However, now that I've moved on and am part of a small startup team working from my home office, that's just not a purchase I was ready to justify again. Nine months into my new adventure with iDoneThis and my enthusiasm is high, yet my back is killing me…

Colin, the founder of, has an awesome and famous post about his $22 standing desk. This is truly a creative gem, that I really wanted to set up for myself.

My problem was that my desk has a raised monitor area. I would either have to remove part of the desk or hack off half of the back legs of the table in Colin's solution. :-(

Desk Sitting

I thought about finding or building a couple simple boxes as the dimensions I would need for the monitor section of my desk and the work surface were roughly the same.

After searching around for those dimensions I found this stackable shelf unit (11.63" H x 24.13" W x 11.63" D and holds up to 20 pounds) at Target. The total cost with tax and shipping was only $19.84 ( due to a 10% off coupon code + free in store pickup).

Once I brought the shelves home, it took me all of 20 minutes to clear my desk, assemble them, and set my gear back up. I've been standing for a week now and once again my back pain has subsided.

Desk Standing

Setting Up PostgreSQL on OS X Yosemite for Local Development

First and foremost, I highly recommend that you download VirtualBox and Vagrant to bootstrap a development server on your Mac.

That being said there are times when you're doing a simple test or tutorial and you'd like to be able to run PostgreSQL on your local machine.

I'm writing this as I found setting this up on OS X 10.10 Yosemite to be a bit of a pain, since a simple homebrew install didn't do the trick for me.

Caution: Before going any further, this tutorial assumes you do not have a prior installation that has data you actually want to keep. If this is not the case then stop now, and backup your data to restore later.

Fire Up That Command Line, It's Time to Dive In.

This is not a production environment and chances are this is a Mac that you alone use. Therefore it's perfectly acceptable to optimize for simplicity and ease of use.

If you've never installed PostgreSQL in the past (if you have skip ahead one step), then create the data directory you need and set the permissions so your user account has full access.

mkdir /usr/local/var/postgres
chmod 770 /usr/local/var/postgres

If you've installed PostgreSQL before (if you haven't you should follow the first step and skip this one) and do not have data you care about, follow these steps to setup your data directory with full access for your user account.
If the first command produces an error just ignore it, you're making sure PostgreSQL isn't loaded already and trying to run before you have things setup correctly.

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
sudo rm -rf /usr/local/var/postgres
mkdir /usr/local/var/postgres
chmod 770 /usr/local/var/postgres

Now install PostgreSQL using [homebrew][]. If you already have it or an old build just uninstall that first. (hint: brew uninstall postgresql)

brew install postgresql

Next initialize the data directory.

initdb -D /usr/local/var/postgres

After the initialization is complete, setup PostgreSQL to run on boot with these two commands. The first creates a symlink to a launch agent and the second tells launchctl that that agent would be loaded now and on boot.

ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

PostgreSQL will now start up and be ready to use. One trick is to run the createdb command with no arguments to create a database named after your user account. You never have to do anything with this database, but this allows you to run the psql command unadorned to connect to PostgreSQL.

Do this now and save keystrokes later.


Now you can connect to your locally running PostgreSQL server just by running this short command.


You're now ready to create a database or two for your projects to use and start hacking. Have fun! :-)