Updated documentation and system requirements

This commit is contained in:
Naomi 2018-09-10 17:23:40 +01:00
parent ffeed9bf94
commit e4a9df0e00
2 changed files with 34 additions and 1 deletions

View File

@ -48,6 +48,8 @@ $ python3 -m venv .venv
$ source .venv/bin/activate
```
(to leave the virtual environment, the command is simply `deactivate`)
## Configure the Environment
```bash
@ -68,7 +70,9 @@ If you run into issues with `psycopg2` you may need to run the following:
$ pip3 uninstall psycopg2 && pip3 install --no-binary :all: psycopg2
```
## Ensure Postgres is running and accessible
## Set up database
### Method 1
You should be able to connect to Postgres:
@ -86,6 +90,34 @@ to change the Postgres authentication options (NB on Fedora / Centos,
$ echo "ALTER USER postgres WITH PASSWORD 'postgres';" | psql -U postgres
```
### Method 2
First you need to switch to the user called postgres - in Linux do
```bash
$ sudo su postgres
```
Then get an interactive postgres shell
```
$ psql
```
Then create a database and a user, and ensure to make the user a superuser (otherwise you will run into trouble when doing the migration and it tries to enable the postgis extension).
```bash
postgres=# create database ojuso;
postgres=# create user ojuso WITH PASSWORD 'ojuso';
postgres=# alter role ojuso SET client_encoding TO 'utf8'; // this is recommended for django
postgres=# alter role ojuso SET default_transaction_isolation TO 'read committed'; // so is this
postgres=# grant all privileges on database ojuso to ojuso;
postgres=# alter user ojuso with superuser;
```
Type `\q` to exist the postgres shell.
Then, in `ojuso-map/ojusomap/settings.py`, edit the `DATABASES` section to add the database name, user and password, which are all 'ojuso' unless you chose different ones in the previous step.
## Run The Migrations
```bash

View File

@ -2,3 +2,4 @@ libgdal-dev
python3-gdal
gdal-bin
postgresql
postgis