Blog
4 Day Work Week
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 readinguWSGI 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 readingPostgres 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 readingDjango 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 ...
Continue readingClass-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 readingDjango 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 ...
Continue readingSetting up a template_postgis on Lucid
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 readingBitten by Python's Pass-By-Reference
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 readingProvisioning a new Ubuntu server for Django
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 readingUsing virtualenvwrapper to start processes and swap config files
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 readingDynamically Updating IP Addresses with Update-ip
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 readingSnippet: Django Columns Filter
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 readingOur Git Workflow
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 readingDjango-Reporter
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 readingCreating a Personal PyPi with Chishop
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 readingA Case Against the Separation of Support and Development
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 readingDRY Ajax 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 readingSwitching from Linux to Mac
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 readingEasily Working With Pinax on Multiple Machines
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 readingLVM-Based Virtualization with KVM and Jaunty
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 readingBrandon 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
- 1
- 2