summaryrefslogtreecommitdiffstats
path: root/localsettingsWSL.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-03-22 02:26:46 +0000
committerPhilip Sargent <philip.sargent@klebos.com>2021-03-22 02:26:46 +0000
commita0f504d1e274ff4804aa6f376ef76267e55ed640 (patch)
tree66653582c2cf48c8d3cb04d60a3078d94d675d28 /localsettingsWSL.py
parent24bab23508196b7a91d94cd087a16ea1c19a25ae (diff)
downloadtroggle-a0f504d1e274ff4804aa6f376ef76267e55ed640.tar.gz
troggle-a0f504d1e274ff4804aa6f376ef76267e55ed640.tar.bz2
troggle-a0f504d1e274ff4804aa6f376ef76267e55ed640.zip
new self-adjusting paths
Diffstat (limited to 'localsettingsWSL.py')
-rw-r--r--localsettingsWSL.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/localsettingsWSL.py b/localsettingsWSL.py
index 92fe3c1..3a0b45c 100644
--- a/localsettingsWSL.py
+++ b/localsettingsWSL.py
@@ -1,6 +1,7 @@
import sys
import os
import urllib.parse
+from unipath import Path
"""Settings for a troggle installation which may vary among different
installations: for development or deployment, in a docker image or
python virtual environment (venv), on ubuntu, debian or in Windows
@@ -26,17 +27,21 @@ print(" * importing troggle/localsettings.py")
SERVERPORT = '8000'
-LIBDIR = '/mnt/d/CUCC-Expo/t37/lib/python3.7/'
-#LIBDIR = '/usr/lib/python3.8/'
+# --------------------- MEDIA redirections BEGIN ---------------------
+#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/t37/'
+REPOS_ROOT_PATH = Path(__file__).ancestor(1)
+LIBDIR = REPOS_ROOT_PATH.child('lib').child('python3.7')
-REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/t37/'
-#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/'
+TROGGLE_PATH = Path(__file__)
+TEMPLATE_PATH = TROGGLE_PATH.child('templates')
+MEDIA_ROOT = TROGGLE_PATH.child('media')
-MEDIA_ROOT = REPOS_ROOT_PATH + 'troggle/media/'
-#MEDIA_URL = urllib.parse.urljoin(URL_ROOT , '/site_media/')
-MEDIA_URL = '/site_media/'
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+MEDIA_URL = '/site-media/'
#STATIC_ROOT removed after merging content into MEDIA_ROOT. See urls.py & core/views_surveys.py
+# --------------------- MEDIA redirections END ---------------------
PUBLIC_SITE = True
DEBUG = True # Always keep this, even when on public server. Otherwise NO ERROR MESSAGES !
@@ -61,9 +66,9 @@ NOTABLECAVESHREFS = [ "264", "258", "204", "76", "107"]
sys.path.append(REPOS_ROOT_PATH)
sys.path.append(REPOS_ROOT_PATH + 'troggle')
-PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/'
+PYTHON_PATH = REPOS_ROOT_PATH.child('troggle')
-LOGFILE = PYTHON_PATH + 'troggle.log'
+LOGFILE = PYTHON_PATH.child(troggle.log')
TEMPLATES = [
{