Changes between Version 55 and Version 56 of GeoDjangoInstall
- Timestamp:
- Aug 16, 2008, 4:31:56 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GeoDjangoInstall
v55 v56 123 123 Next, create a role and database for your application, and allow it to access PostGIS functionality. 124 124 125 Start by switching into the `postgres user` 125 Start by switching into the `postgres user`(see below about db initialization if you don't have a postgres user) 126 126 {{{ 127 127 # su - postgres … … 131 131 $ createuser <user> 132 132 }}} 133 If you get any error see http://www.postgresql.org/docs/8.3/interactive/tutorial-createdb.html 133 * Note: if you have not initialized the postgres db cluster (if you used apt-get to install postgresql this was already done) do this: 134 {{{ 135 sudo adduser postgres 136 # run through interactive prompt 137 sudo su - postgres 138 mkdir /path/to/postgres/data 139 chmod -R 700 /path/to/postgres/data 140 initdb -D /path/to/postgres/data 141 pg_ctl start -D /path/to/postgres/data 142 }}} 143 If you get any errors see http://www.postgresql.org/docs/8.3/interactive/tutorial-createdb.html 144 145 Now, create the database with your chosen user: 134 146 {{{ 135 147 $ createdb -O <user> <db_name> 136 148 $ createlang plpgsql <db_name> 137 149 }}} 150 138 151 Now, load the postgis sql functions and spatial_ref_table of projection information. 139 Note: PostGIS SQL files are ''ususally'' installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below; use the `pg_config --sharedir` command to determine this directory on your system, which can vary widely depending on your PostgreSQL version and install method as well as how you install postgis, ie from source or with apt-get). 152 153 Note: PostGIS SQL files are ''ususally'' installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below). Use the `pg_config --sharedir` command to determine this directory on your system, which can vary widely depending on your PostgreSQL version and install method. 154 155 In addition, depending on your install method for postgis the sql files may be in another location like `/usr/share'. 156 140 157 {{{ 141 158 $ psql -d <db_name> -f /usr/postgres/8.2/share/lwpostgis.sql # check your PostgreSQL Version, 8.x