Django Posts

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

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

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

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

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

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

Django Dev, Test, and Prod Environments Revisited

Posted in Django on March 10, 2009 (view comments)

Back in November, I posted a detailed entry about the environments I used to develop, test, and deploy my Django applications. Since then, I've made a lot of changes to my configuration that I feel have helped boost my productivity and effectiveness. I wanted to talk a little bit about ...

Continue reading

Ajax Django Comments With jQuery

Posted in Django on February 16, 2009 (view comments)

NOTE: This example is outdated, and it violates the DRY principal. For a revised look at this topic, check out my more recent post here: DRY Ajax Comments I haven't posted here in awhile because of quite a few things going on in my personal and professional life lately. Things ...

Continue reading

Django's Dynamic URLs

Posted in Django on November 21, 2008 (view comments)

One of the strengths of the Django framework is its emphasis on the Don't Repeat Yourself philosophy. From Wikipedia: "The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency." This approach has many advantages in ...

Continue reading

My Django Development, Testing, and Production Environments

Posted in Django on November 18, 2008 (view comments)

I've seen a lot of discussion lately about different strategies for developing and deploying Django applications. I wanted to share my current environment in the hopes that it might help someone new to Django or software development in general, and I was also hoping for some constructive criticism so that ...

Tags: development
Continue reading

Django-Picasso

Posted in Django on October 22, 2008 (view comments)

I love Google's Picasa desktop application, and the ability to upload photos to the Picasa Web Albums site using the app is extremely useful. When I built my personal website using Django, I wanted a way to use Picasa Web Albums as a backend for my photos section so that ...

Continue reading

Django Colors for Eclipse

Posted in Django on September 23, 2008 (view comments)

For a long time now, I've been using Gedit + plugins as an integrated development environment. I recently began using SVN to manage version control, however, and I wasn't able to find a good SVN client plugin for Gedit. I decided to see what else was out there, and after ...

Continue reading

Django with Apache and mod_auth_sspi

Posted in Django on September 13, 2008 (view comments)

I recently finished up a project for a company intranet using Windows. Though Windows is not my favorite environment, Django works flawlessly there so it usually doesn't present many problems. One of the features needed for the site was automatic authentication through integrated Windows security. To achieve this, I used ...

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.