public
Last active

GeoDjango dependencies on OSX

  • Download Gist
osx_geodjango_deps.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
# Freshen homebrew
brew update
brew upgrade
 
# The main stuff we need
brew install postgresql
brew install postgis
brew install gdal
 
# Switch to postgis version 1.5.3 - 2.0 not supported yet
# in /usr/local
git checkout -b postgis1.5.3 cb3d49e
brew unlink postgis
brew install postgis
 
# Create and start a postgresql DB as your non-root user
mkdir -p ~/var/data/postgres
mkdir -p ~/var/log/postgres
touch ~/var/log/postgres/server.log
initdb ~/var/data/postgres
pg_ctl -D ~/var/data/postgres -l ~/var/log/postgres/server.log start
 
# Create the template_postgis postgres DB template
# Alter the SQL paths as needed for the version of postgresql that you install with brew
createdb -h localhost template_postgis
psql -h localhost -d template_postgis -f /usr/local/share/postgis/postgis.sql
psql -h localhost -d template_postgis -f /usr/local/share/postgis/spatial_ref_sys.sql
 
# Finally, create the GeoDjango DB with the template_postgis template
createdb -h localhost -T template_postgis geodjango
 
# Other stuff...
 
# Get postgres status
pg_ctl -D ~/var/data/postgres status
# Stop your postgres DB
pg_ctl -D ~/var/data/postgres stop -s -m fast

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.