Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow usage without Docker
  • Loading branch information
kthoden committed Sep 15, 2020
1 parent 59b3bb2 commit ae80ca2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/website/settings.py
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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'

0 comments on commit ae80ca2

Please sign in to comment.