2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 01:27:08 +00:00

fixing paths in settings to be Path() not str()

This commit is contained in:
2023-03-08 18:24:57 +00:00
parent 301fa1fce1
commit b3d9eeecd2
6 changed files with 175 additions and 40 deletions

View File

@@ -46,7 +46,6 @@ 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'
TROGGLE_PATH = Path(__file__).parent
TEMPLATE_PATH = TROGGLE_PATH / "templates"
@@ -58,7 +57,12 @@ EXPOFILES = REPOS_ROOT_PATH / "expofiles"
SCANS_ROOT = EXPOFILES / "surveyscans"
PHOTOS_ROOT = EXPOFILES / "photos"
PHOTOS_YEAR = "2022"
PHOTOS_YEAR = "2023"
NOTABLECAVESHREFS = ["290", "291", "264", "258", "204", "359", "76", "107"]
PYTHON_PATH = REPOS_ROOT_PATH / "troggle"
LOGFILE = PYTHON_PATH / "troggle.log"
# 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).
@@ -118,11 +122,6 @@ if DBSWITCH == "sqlite":
if DBSWITCH == "mariadb":
DATABASES = DBMARIADB
NOTABLECAVESHREFS = ["290", "291", "359", "264", "258", "204", "76", "107"]
PYTHON_PATH = REPOS_ROOT_PATH / "troggle"
LOGFILE = PYTHON_PATH / "troggle.log"
TEMPLATES = [
@@ -165,29 +164,18 @@ DEFAULT_FROM_EMAIL = "django-test@klebos.net"
SURVEX_DATA = REPOS_ROOT_PATH / "loser"
DRAWINGS_DATA = REPOS_ROOT_PATH / "drawings"
EXPOWEB = REPOS_ROOT_PATH / "expoweb"
CAVEDESCRIPTIONS = EXPOWEB / "cave_data"
ENTRANCEDESCRIPTIONS = EXPOWEB / "entrance_data"
EXPOWEB_URL = ""
# SCANS_URL = '/survey_scans/' # defunct, removed.
# 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 = 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))
#TINY_MCE_MEDIA_ROOT = STATIC_ROOT + '/tiny_mce/' # not needed while TinyMCE not installed
#TINY_MCE_MEDIA_URL = STATIC_URL + '/tiny_mce/' # not needed while TinyMCE not installed
# Sanitise these to be strings as Django seems to be particularly sensitive to crashing if they aren't
STATIC_URL = str(STATIC_URL) + "/"
MEDIA_URL = str(MEDIA_URL) + "/"