commit 2de7f2fea15866711702b54165af1c8ac78e5951 Author: Oto Imrich Date: Tue Sep 26 18:11:40 2023 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2602141 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.venv +.idea +.config.cfg \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/config.py b/app/config.py new file mode 100644 index 0000000..1974439 --- /dev/null +++ b/app/config.py @@ -0,0 +1,15 @@ +import configparser +from os import path + +# parse base config file +config = configparser.ConfigParser() +config_path = path.dirname(path.abspath(__file__)) +config.read(path.join(config_path, "../config_base.cfg")) + +# check if custom configuration file exists and eventually load it +if path.exists((cfg_pth := path.join(config_path, "../config.cfg"))): + config.read(cfg_pth) + +settings = { + "mongodb_url": config.get("DB","MONGODB_URL") +} \ No newline at end of file diff --git a/config_base.cfg b/config_base.cfg new file mode 100644 index 0000000..21daf43 --- /dev/null +++ b/config_base.cfg @@ -0,0 +1,2 @@ +[DB] +MONGODB_URL = "mongodb://localhost:27017" \ No newline at end of file diff --git a/flaskapp.py b/flaskapp.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/scraper.py b/scraper.py new file mode 100644 index 0000000..e69de29