diff --git a/src/website/settings.py b/src/website/settings.py index 118ff42..1409a4c 100644 --- a/src/website/settings.py +++ b/src/website/settings.py @@ -16,7 +16,13 @@ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = Path(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -RES_DIR = Path(os.environ['RES_DIR']) +try: + RES_DIR = Path(os.environ['RES_DIR']) + USE_DOCKER = True +except KeyError: + RES_DIR = Path(Path(os.path.dirname(BASE_DIR)) / "res") + USE_DOCKER = False + INPUT_DIR = RES_DIR / "input" XML_DIR = RES_DIR / "xml" # xml files are stored here: @@ -26,7 +32,7 @@ # publications xml files are stored here: PUBL_XML_DIR = RES_DIR / "publications" -PUBL_STATIC_DIR = RES_DIR / "static" / "publications" +PUBL_STATIC_DIR = RES_DIR / "all_static_files" / "publications" # Quick-start development settings - unsuitable for production @@ -187,11 +193,14 @@ STATICFILES_DIRS = [ PUBL_STATIC_DIR, - RES_DIR / "static" / "webdesign_platform", + STATIC_ROOT / "webdesign_platform", ] # Exist DB Settings -EXISTDB_SERVER_URL = "http://xmldb:8080/exist" +if USE_DOCKER: + EXISTDB_SERVER_URL = "http://xmldb:8080/exist" +else: + EXISTDB_SERVER_URL = "http://localhost:8080/exist" EXISTDB_SERVER_USER = 'admin' EXISTDB_SERVER_PASSWORD = '' # EXISTDB_ROOT_COLLECTION = '/db/xml_files/publications'