Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-09-20 12:00:28 +00:00
commit f42f4131b8
3 changed files with 42 additions and 1 deletions

View File

@ -48,6 +48,8 @@ $ python3 -m venv .venv
$ source .venv/bin/activate $ source .venv/bin/activate
``` ```
(to leave the virtual environment, the command is simply `deactivate`)
## Configure the Environment ## Configure the Environment
```bash ```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 $ 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: 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 $ 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 ## Run The Migrations
```bash ```bash

View File

@ -568,5 +568,13 @@ function initDrafts() {
initDrafts() initDrafts()
</script> </script>
<script>
<!-- Jump to error -->
$(function() {
if ($('.has-error')) {
location.href = '#' + $('.has-error:first').attr('id');
}
});
</script>
{% endblock %} {% endblock %}

View File

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