summaryrefslogtreecommitdiffstats
path: root/_deploy/wsl/localsettingsWSL.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2022-12-23 22:13:11 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2022-12-23 22:13:11 +0000
commita71c616afdca1505d8cc722eb52034c065dd1ee5 (patch)
tree5802d8ef8b1efe829ce1b7803665f856d69b291f /_deploy/wsl/localsettingsWSL.py
parent9c39c9dcff2679de4a1c30ed7122ec71e69cc949 (diff)
downloadtroggle-a71c616afdca1505d8cc722eb52034c065dd1ee5.tar.gz
troggle-a71c616afdca1505d8cc722eb52034c065dd1ee5.tar.bz2
troggle-a71c616afdca1505d8cc722eb52034c065dd1ee5.zip
update deprecations etc
Diffstat (limited to '_deploy/wsl/localsettingsWSL.py')
-rw-r--r--_deploy/wsl/localsettingsWSL.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/_deploy/wsl/localsettingsWSL.py b/_deploy/wsl/localsettingsWSL.py
index 2584732..c67f54e 100644
--- a/_deploy/wsl/localsettingsWSL.py
+++ b/_deploy/wsl/localsettingsWSL.py
@@ -47,7 +47,7 @@ PV = "python" + str(sys.version_info.major) + "." + str(sys.version_info.minor)
# --------------------- MEDIA redirections BEGIN ---------------------
REPOS_ROOT_PATH = Path(__file__).parent.parent
LIBDIR = REPOS_ROOT_PATH / 'lib' / PV
-#LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.9' # should be finding this automatically: python --version etc.
+#LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.9'
TROGGLE_PATH = Path(__file__).parent
TEMPLATE_PATH = TROGGLE_PATH / 'templates'
@@ -55,7 +55,8 @@ MEDIA_ROOT = TROGGLE_PATH / 'media'
JSLIB_ROOT = TROGGLE_PATH / 'media' / 'jslib' # used for CaveViewer JS utility
#FILES = Path('/mnt/d/expofiles/')
-EXPOFILES = Path('/mnt/d/EXPO/expofiles/')
+EXPOFILES = REPOS_ROOT_PATH / "expofiles"
+
SCANS_ROOT = EXPOFILES / 'surveyscans'
PHOTOS_ROOT = EXPOFILES / 'photos'
PHOTOS_YEAR = "2022"
@@ -64,19 +65,18 @@ PHOTOS_YEAR = "2022"
# trailing slash if there is a path component (optional in other cases).
MEDIA_URL = '/site-media/'
-DIR_ROOT = ''#this should end in / if a value is given
+DIR_ROOT = Path('') #this should end in / if a value is given
URL_ROOT = '/'
# URL_ROOT = 'http://localhost:'+ SERVERPORT +'/'
#Note that these constants are not actually used in urls.py, they should be..
-MEDIA_URL = urllib.parse.urljoin(URL_ROOT , '/site_media/')
-SCANS_URL = urllib.parse.urljoin(URL_ROOT , '/survey_scans/')
-PHOTOS_URL = urllib.parse.urljoin(URL_ROOT , '/photos/')
-SVX_URL = urllib.parse.urljoin(URL_ROOT , '/survex/')
+# and they all need to end with / so using 'Path' doesn't work..
+MEDIA_URL = Path(URL_ROOT , '/site_media/')
+PHOTOS_URL = Path(URL_ROOT , '/photos/')
-STATIC_URL = urllib.parse.urljoin(URL_ROOT , '/static/') # used by Django admin pages. Do not delete.
-JSLIB_URL = urllib.parse.urljoin(URL_ROOT , '/javascript/') # used for CaveViewer JS utility
+STATIC_URL = Path(URL_ROOT , '/static/') # used by Django admin pages. Do not delete.
+JSLIB_URL = Path(URL_ROOT , '/javascript/') # used for CaveViewer JS utility
#STATIC_ROOT removed after merging content into MEDIA_ROOT. See urls.py & core/views/surveys.py
# --------------------- MEDIA redirections END ---------------------
@@ -92,7 +92,7 @@ SURVEXPORT = 'survexport' # for parsing .3d files and producing .pos files
DBSQLITE = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME' : 'troggle.sqlite',
+ 'NAME' : '/home/philip/p11d5/troggle.sqlite',
# 'NAME' : ':memory:',
'USER' : 'expo', # Not used with sqlite3.
'PASSWORD' : 'sekrit', # Not used with sqlite3.
@@ -122,11 +122,9 @@ if DBSWITCH == "mariadb":
NOTABLECAVESHREFS = [ "290", "291", "359", "264", "258", "204", "76", "107"]
PYTHON_PATH = REPOS_ROOT_PATH / 'troggle'
-sys.path.append(os.fspath(REPOS_ROOT_PATH))
-sys.path.append(os.fspath(PYTHON_PATH))
LOGFILE = PYTHON_PATH / 'troggle.log'
-PYTHON_PATH = os.fspath(PYTHON_PATH)
+
TEMPLATES = [
{
@@ -156,9 +154,6 @@ TEMPLATES = [
},
]
-EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"
-EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"
-
EXPOUSER = 'expo'
EXPOUSER_EMAIL = 'philip.sargent@gmail.com'
EXPOADMINUSER = 'expoadmin'
@@ -172,9 +167,8 @@ DEFAULT_FROM_EMAIL = 'django-test@klebos.net'
SURVEX_DATA = REPOS_ROOT_PATH / "loser"
DRAWINGS_DATA = REPOS_ROOT_PATH / "drawings"
-
EXPOWEB = REPOS_ROOT_PATH / "expoweb"
-#SURVEYS = REPOS_ROOT_PATH
+
CAVEDESCRIPTIONS = EXPOWEB / "cave_data"
ENTRANCEDESCRIPTIONS = EXPOWEB / "entrance_data"
EXPOWEB_URL = ''
@@ -182,15 +176,21 @@ EXPOWEB_URL = ''
# Sanitise these to be strings as all other code is expecting strings
# and we have not made the change to pathlib Path type in the other localsettings-* variants yet.
-CAVEDESCRIPTIONS = os.fspath(CAVEDESCRIPTIONS)
-ENTRANCEDESCRIPTIONS = os.fspath(ENTRANCEDESCRIPTIONS)
-LOGFILE = os.fspath(LOGFILE)
-#SURVEYS = os.fspath(SURVEYS)
-EXPOWEB = os.fspath(EXPOWEB)
-DRAWINGS_DATA = os.fspath(DRAWINGS_DATA)
-SURVEX_DATA = os.fspath(SURVEX_DATA)
-REPOS_ROOT_PATH = os.fspath(REPOS_ROOT_PATH)
-TEMPLATE_PATH = os.fspath(TROGGLE_PATH)
-MEDIA_ROOT = os.fspath(MEDIA_ROOT)
-JSLIB_ROOT = os.fspath(JSLIB_ROOT)
-SCANS_ROOT = os.fspath(SCANS_ROOT)
+# CAVEDESCRIPTIONS = str(CAVEDESCRIPTIONS)
+# ENTRANCEDESCRIPTIONS = str(ENTRANCEDESCRIPTIONS)
+# LOGFILE = str(LOGFILE)
+# EXPOWEB = str(EXPOWEB)
+# DRAWINGS_DATA = str(DRAWINGS_DATA)
+# SURVEX_DATA = str(SURVEX_DATA)
+# TEMPLATE_PATH = str(TROGGLE_PATH)
+# MEDIA_ROOT = str(MEDIA_ROOT)
+# JSLIB_ROOT = str(JSLIB_ROOT)
+# SCANS_ROOT = str(SCANS_ROOT)
+# EXPOFILES = str(EXPOFILES)
+# PHOTOS_ROOT = str(PHOTOS_ROOT)
+STATIC_URL = str(STATIC_URL) +"/"
+MEDIA_URL = str(MEDIA_URL) +"/"
+# PYTHON_PATH = str(PYTHON_PATH)
+# REPOS_ROOT_PATH = str(REPOS_ROOT_PATH)
+sys.path.append(str(REPOS_ROOT_PATH))
+sys.path.append(str(PYTHON_PATH)) \ No newline at end of file