def setup_geodjango():
    install_packages(["proj", ])
    run("mkdir -p ~/pkgs")
    with cd("~/pkgs"):
        # http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#ibex
        # Download and install some more stuff for proj (from the Django documentation)
        run("wget http://download.osgeo.org/proj/proj-datumgrid-1.4.tar.gz")
        run("mkdir -p nad")
        with cd("nad"):
            run("tar xzf ../proj-datumgrid-1.4.tar.gz")
            run("nad2bin null < null.lla")
            sudo("cp null /usr/share/proj")
        # Download and install the latest GEOS package (http://trac.osgeo.org/geos/).
        # Ubuntu provides a version that is too old for our purposes.
        run("wget http://download.osgeo.org/geos/geos-3.2.2.tar.bz2")
        run("tar xvjf geos-3.2.2.tar.bz2")
        with cd("geos-3.2.2"):
            run("./configure")
            sudo("make && make install")
        # Download and install the latest PostGIS package
        run("wget http://postgis.refractions.net/download/postgis-1.5.2.tar.gz")
        run("tar xvzf postgis-1.5.2.tar.gz")
        with cd("postgis-1.5.2"):
            run("./configure")
            sudo("make && make install")
        # Download and install GDAL
        run("wget http://download.osgeo.org/gdal/gdal-1.7.3.tar.gz")
        run("tar xzf gdal-1.7.3.tar.gz")
        with cd("gdal-1.7.3"):
            run("./configure")
            sudo("make && make install")
    # Make sure PostGIS can find GEOS
    sudo("ldconfig")
    # Set up template_postgis database
    with cd("/var/lib/postgresql"):
        put(script("create_template_postgis-1.5.sh"), ".", mode="0755")
        sudo("./create_template_postgis-1.5.sh", user="postgres")
Helper method which pre-populates the persistence_service with the
dataset/ETHPy150Open typeish/django-deploy/django_deploy/system.py/setup_geodjango--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/test/test_httpapi.py/UpdatePrimaryDatasetTestsMixin._test_change_primary