forked from edward/owl-map
Compare commits
No commits in common. "171d13f9ca4c5b4e247a0f4325a2da296f6b39f9" and "9f90fbd52de6857d9d634c9d63674f7aaec6e07c" have entirely different histories.
171d13f9ca
...
9f90fbd52d
10
README.md
10
README.md
|
@ -2,8 +2,7 @@
|
|||
|
||||
## Setup
|
||||
* clone the project
|
||||
* install geoip and postgis from your local package manager
|
||||
* `$ sudo pacman -S postgis geoip`
|
||||
* install geoip and postgres from your local package manager
|
||||
* setup postgres on your machine, see e.g. https://wiki.archlinux.org/title/PostgreSQL
|
||||
* `$ sudo su postgres`
|
||||
* `$ initdb -D /var/lib/postgres/data`
|
||||
|
@ -11,14 +10,13 @@
|
|||
* create postgres user
|
||||
* `$ sudo su postgres`
|
||||
* `$ createuser --interactive` -> "owl" role with relevant priviledges
|
||||
* create postgres database "matcher" with hstore and postgis extensions
|
||||
* create postgres database "matcher"
|
||||
* `$ psql -U postgres`
|
||||
* `> CREATE DATABASE matcher;`
|
||||
* `> ALTER DATABASE matcher OWNER TO owl;`
|
||||
* `> CREATE EXTENSION hstore;`
|
||||
* `> CREATE EXTENSION postgis;`
|
||||
* create the db tables
|
||||
* setup database credentials and name in default.py
|
||||
* TODO find out where credentials are stored
|
||||
* setup credentials in default.py
|
||||
* `$ python create_db.py`
|
||||
* setup a venv
|
||||
* enter the venv, e.g. in pycharm
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
"""Sample config."""
|
||||
|
||||
# POSTGIS
|
||||
DB_USER = "owl"
|
||||
DB_NAME = "matcher"
|
||||
|
||||
ID_TAGGING_SCHEMA_DIR = "/var/lib/data/id-tagging-schema"
|
||||
ID_PRESET_DIR = "/var/lib/data/id-tagging-schema/data/presets/"
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
from sqlalchemy.schema import CreateIndex, CreateTable
|
||||
|
||||
from config.default import DB_USER, DB_NAME
|
||||
from matcher import database, model
|
||||
|
||||
DB_URL = f"postgresql://{DB_USER}@localhost/{DB_NAME}"
|
||||
DB_URL = "postgresql:///matcher"
|
||||
database.init_db(DB_URL)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue