django

Setting DJANGO_SETTINGS_MODULE

Here’s a bash function I use for Django development to quickly set DJANGO_SETTINGS_MODULE.

function setdsm() { 
    # add the current directory and the parent directory to PYTHONPATH
    # sets DJANGO_SETTINGS_MODULE
    export PYTHONPATH=$PYTHONPATH:$PWD/..
    export PYTHONPATH=$PYTHONPATH:$PWD
    if [ -z "$1" ]; then 
        x=${PWD/\/[^\/]*\/}               
        export DJANGO_SETTINGS_MODULE=$x.settings
    else    
        export DJANGO_SETTINGS_MODULE=$1 
    fi

    echo "DJANGO_SETTINGS_MODULE set to $DJANGO_SETTINGS_MODULE"
}

I put this in my .bash_profile, then a quick setdsm sets the DJANGO_SETTINGS_MODULE to the settings.py in the current directory and add the current directory and it’s parent to PYTHONPATH.

Heatmapping Google Earth

In last week’s post, we spoke of building a toolchain that makes it easy to develop Google Earth overlays of customer data.

In this screencast (now with audio!), we’ve taken fictitious customer data and developed a Django application that allows us to manipulate dynamic heatmaps of customer locations. This is all done with just a few hundred lines of Python code.

The roadmap to discovering value in your corporate data is seldom clear. It helps to push and prod, pull and stretch the data in a search for insights. Ad-hoc data mash-ups like this one open the door for new creativity and insights.

Heatmap

Building the Geotoolchain

We try to create simple tools to visualize our client’s data and flexibly expand them as business demands and information grows. One dimension of customer location that often gets overlooked is geolocation. Microsoft MapPoint and ArcGIS have made the ability to overlay different forms of business data. But they’re relatively expensive, complex and not exactly agile.

The question is how to open up geographic business intelligence to not just a few people in the organization, but to all.

Enter Google Earth. Below are crime rates in Portland, Oregon courtesy of Portland Maps.

The folks at Portland Maps are steps ahead of the rest of the Google Earth community with their visualization of Portland area information. What they’re doing is not just displaying points in a map, but processing those points to show density heatmaps. It’s easy to see how useful this could be to the real estate industry or anyone thinking of moving to the Portland area.

Webservices have made geocoding cheap and accessible. The challenge is to create tools for rapid data access and development. That’s why we’re excited about powerful development frameworks like Django. All the pieces are there; geocode your customer information, process and serve it through Django, and democratize visualization in your organization using Google Earth.

We’re working on a screencast that shows how we remixed these tools into a toolchain that provides real geographic insight.