title: Trouble Installing Postgis (PostgreSQL)(Django)(Mac OS x 10.7)
body: <p>EDIT:</p>
  
  <p>Ok, I uninstalled the versions that I had and reinstalled according to the directions listed below:</p>
  
  <p>I ran:</p>
  
  <pre><code>POSTGIS_SQL_PATH=/usr/local/Cellar/postgis15/1.5.3/share/postgis
  # Creating the template spatial database.
  createdb -E UTF8 template_postgis
  createlang -d template_postgis plpgsql # Adding PLPGSQL language support.
  # Allows non-superusers the ability to create from this template
  psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
  # Loading the PostGIS SQL routines
  psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
  psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
  # Enabling users to alter spatial tables.
  psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
  psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
  psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" 
  </code></pre>
  
  <p>then ran:</p>
  
  <pre><code>$ createdb -T template_postgis newdb
  $ createuser --createdb poop
  Shall the new role be a superuser? (y/n) y
  </code></pre>
  
  <p>Now Here is what I get for my db list:</p>
  
  <pre><code>$ psql -l
                                    List of databases
         Name       | Owner | Encoding |  Collation  |    Ctype    | Access privileges 
  ------------------+-------+----------+-------------+-------------+-------------------
   newdb            | User  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   postgres         | User  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   template0        | User  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/User          +
                    |       |          |             |             | User=CTc/User
   template1        | User  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/User          +
                    |       |          |             |             | User=CTc/User
   template_postgis | User  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
  (5 rows)
  </code></pre>
  
  <p>Making sure my version is correct:</p>
  
  <pre><code>$ psql newdb
  psql (9.0.8)
  Type "help" for help.
  
  newdb=# SELECT PostGIS_full_version();
                                         postgis_full_version                                       
  --------------------------------------------------------------------------------------------------
   POSTGIS="1.5.3" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.3" USE_STATS
  (1 row)
  
  newdb=# \dt
           List of relations
   Schema |       Name       | Type  | Owner 
  --------+------------------+-------+-------
   public | geometry_columns | table | User
   public | spatial_ref_sys  | table | User
  (2 rows)
  </code></pre>
  
  <p>It looks like all dependencies are taken care of and the database looks happy, everything looks clean! (However, where is the geograph_colums I grated all users access to above?)</p>
  
  <p>Now, settings.py:</p>
  
  <pre><code>DATABASES = {
      'default': {
           'ENGINE': 'django.contrib.gis.db.backends.postgis',
           'NAME': 'newdb',
           'USER': 'poop', # yes, I named my user poop
       }
  }
  </code></pre>
  
  <p>now when I run:</p>
  
  <pre><code>$ python manage.py syncdb
  </code></pre>
  
  <p>I get a link through of various files ending with:</p>
  
  <pre><code>psycopg2.OperationalError: could not connect to server: Permission denied
  Is the server running locally and accepting
  connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
  </code></pre>
  
  <p>Obviously my db is running because I can psql into it. However are permissions set up incorrectly?</p>
  
  <p>pg_hba.conf:</p>
  
  <pre><code># TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     trust
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            trust
  # IPv6 local connections:
  host    all             all             ::1/128                 trust
  </code></pre>
  
  <p>ANSWER:
  <a href="https://stackoverflow.com/questions/9133870/postgresql-socket-error-on-osx-10-7-3-when-running-djangos-syncdb">Postgresql socket error on OSX 10.7.3 when running Django&#39;s syncdb</a></p>