Home Blog

4 Day Work Week

Posted in Business on July 15, 2011 (view comments)

Since I began working with Lincoln Loop, I’ve been absolutely loving the flexibility. What has surprised me, though, is how hard it has been to consistently put in 40 hours a week. There were several weeks when it was even difficult for me to get to 32 hours, which is ...

Continue reading

uWSGI and Django Secure Requests

Posted in Django on October 29, 2010 (view comments)
uWSGI and Django Secure Requests

A colleague and I ran into a frustrating situation this evening when transitioning a site from Apache and mod_wsgi to uWSGI. Django's request.is_secure() wasn't working correctly. After much Googling and shouting at the SSH console, we finally discovered the UWSGI_SCHEME uWSGI parameter. To fix the issue, we edited /etc/nginx/uwsgi_params (which ...

Continue reading

Postgres 9 Streaming Replication and Django-Balancer

Posted in Django Systems Ubuntu on October 20, 2010 (view comments)
Postgres 9 Streaming Replication and Django-Balancer

Over the past couple of weeks I've had the opportunity to dig in to Postgres 9's streaming replication. What I found was a relatively easy way to configure a system for basic replication with very impressive speed. Postgres's streaming replication is an enhancement to the log-shipping warm standby that was ...

Continue reading

Django Admin Customization Examples

Posted in Django on October 4, 2010 (view comments)
Django Admin Customization Examples

I've worked on a couple of projects recently that required some customization of the Django admin. One of the things that I love about Django's built-in admin is that it is created with a very extensible class-based structure. Here are some of the ways I was able to customize the ...

Tags: admin
Continue reading

Class-based Views with Django-Baseviews

Posted in Django on September 28, 2010 (view comments)
Class-based Views with Django-Baseviews

I've always loved the concept of class-based views because views often become repetitive. There are a lot of common operations in a view that work best when they are defined once and reused. Class inheritance, in my opinion, is the best way to keep views DRY and allow you to ...

Continue reading

Django on uWSGI and Nginx

Posted in Django on September 14, 2010 (view comments)
Django on uWSGI and Nginx

I recently moved Pegasus News from Perlbal, Lighttpd, and Apache to Nginx and uWSGI. We balance the traffic between 3 physical servers, and the systems were struggling under the load even after weeks of Apache conf tweaking. We began having issues with excessively slow page loads, request timeouts, and intermittent ...

Tags: nginxuwsgi
Continue reading

Setting up a template_postgis on Lucid

Posted in Django on July 19, 2010 (view comments)

I wasn't able to find instructions in the Django docs for setting up a template_postgis database with postgis-1.5 and Postgres 8.4 on Ubuntu Lucid (10.04). Below is what worked for me. GeoDjango installed via Ubuntu 10.04 packages #!/usr/bin/env bash POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib createdb -E UTF8 template_postgis # Create the template spatial ...

Continue reading

Bitten by Python's Pass-By-Reference

Posted in Python on July 14, 2010 (view comments)

I just got bitten by an interesting bug related to Python's pass-by-reference feature. I had a class method (my_method) with a keyword argument (my_kwarg) that defaulted to {}. I thought that each time my_method was called, if my_kwarg wasn't passed then it would default to an empty dict. In reality, ...

Continue reading

Provisioning a new Ubuntu server for Django

Posted in Django Systems Ubuntu on June 25, 2010 (view comments)

I've been a long-time satisfied user of Webfaction, but recently I've had a strong urge to move to VPS hosting so that I can have greater control over the environment. After some research, I went with Rackspace Cloud because of the incredibly cheap low-end options. My site doesn't use a ...

Continue reading

Using virtualenvwrapper to start processes and swap config files

Posted in Django Python on June 22, 2010 (view comments)

I do my Django development work locally on OS X, so I have several different daemons installed on my machine. I used to keep Postgres, MySQL, lighttpd, memcached, and more set up to autostart and run continuously, but I didn't like the burden on performance (real or imagined). Also, I ...

Continue reading

Dynamically Updating IP Addresses with Update-ip

Posted in Python Ubuntu on May 29, 2010 (view comments)

A couple of years ago, I write a post including a snippet to automatically update your DNS overrides with WebFaction. That script served my purpose well until I moved to an ISP that gave me a static IP. Recently, though, I moved to a new apartment and signed up for ...

Continue reading

Snippet: Django Columns Filter

Posted in Django on May 26, 2010 (view comments)

I was looking around for an easy way to split lists of items into columns in a way that the number of items in each column would be less than or equal to the number of items in the first column. This prevents a final column with several more items ...

Continue reading

Our Git Workflow

Posted in Methodology Programming on April 28, 2010 (view comments)

NOTE: Brian Rosner pointed out that git merge --no-ff may accomplish exactly what we're looking for without messing with rebasing. He shared this post about a git branching model. I tried that method, but it still inserts the individual commits into the master timeline, making it unsuitable for a public ...

Continue reading

Django-Reporter

Posted in Django on April 5, 2010 (view comments)

This week I finished up the initial release of Django-Reporter, my first open-source project based on work I've done for my full-time employer, Pegasus News. At Pegasus we send daily, weekly, and monthly email reports out to several people. We have a quite complex codebase, so we need these reports ...

Continue reading

Creating a Personal PyPi with Chishop

Posted in Django on March 25, 2010 (view comments)

At Pegasus News, we run custom deploy scripts that use pip to read through a requirements.txt file and keep our virtualenvs up to date. We use quite a few 3rd-party Django apps that we pull from PyPi, along with several apps - both internal and 3rd-party - from Github and ...

Continue reading

A Case Against the Separation of Support and Development

Posted in Methodology on November 2, 2009 (view comments)

Many large companies have made the decision to separate the support of software from its development - forming separate teams to focus entirely on one activity. The reasons behind this decision make a lot of sense on the surface. Developers are free to focus entirely on their projects unhindered by ...

Continue reading

DRY Ajax Comments

Posted in Django on October 24, 2009 (view comments)

Back in February, I posted an entry about adding Ajax functionality to the built-in comments app. I always intended to go back and improve this method, but didn't get the chance until now. Yesterday I decided to take another look, and I found a much better way of achieving this ...

Continue reading

Switching from Linux to Mac

Posted in Systems on October 6, 2009 (view comments)

Embracing Minimalism Over the course of the last year, I've slowly gone through a major shift in my philosophy about technology and about life in general. I've begun to see the great value of minimalism, and as a result I've begun to strive for elegant simplicity. For a long time, ...

Continue reading

Easily Working With Pinax on Multiple Machines

Posted in Django on August 11, 2009 (view comments)

I've been working on a project using the excellent Pinax platform, and I wanted to share some of the tricks I use to make it easier to work with. You can find out more about Pinax by visiting their site. I'm working with their recent 0.7beta3 release, so if you're ...

Continue reading

LVM-Based Virtualization with KVM and Jaunty

Posted in Ubuntu on April 27, 2009 (view comments)

A month ago, I had three tower PCs running in my home office 24x7 - a desktop PC, a web server, and a home media server. Routinely high electric bills prompted me to make the decision to combine the two servers into one, but I wanted to do everything possible ...

Continue reading
Brandon Konkle

I've been creating websites for over 10 years, and I've been using Django since early 2008. I focus on high quality, well-tested, maintainable code and reliable high-performance deployments. Web development is something that I am very excited about, and I love finding elegant and innovative ways to push web applications further.

Latest Comments

© 2011 Copyright Brandon Konkle. All Rights Reserved.