Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f42f4131b8
34
README.md
34
README.md
@ -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
|
||||
|
@ -568,5 +568,13 @@ function initDrafts() {
|
||||
|
||||
initDrafts()
|
||||
</script>
|
||||
<script>
|
||||
<!-- Jump to error -->
|
||||
$(function() {
|
||||
if ($('.has-error')) {
|
||||
location.href = '#' + $('.has-error:first').attr('id');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -2,3 +2,4 @@ libgdal-dev
|
||||
python3-gdal
|
||||
gdal-bin
|
||||
postgresql
|
||||
postgis
|
||||
|
Loading…
Reference in New Issue
Block a user