diff --git a/README.md b/README.md index 6a5bec6..f091533 100644 --- a/README.md +++ b/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 diff --git a/config/example.py b/config/example.py index 26b8a0e..28f5052 100644 --- a/config/example.py +++ b/config/example.py @@ -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/" diff --git a/create_db.py b/create_db.py index 761fce7..2c1c6f9 100755 --- a/create_db.py +++ b/create_db.py @@ -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)