diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-02-25 18:33:34 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-02-25 18:33:34 +0000 |
commit | 7f542b8936c6690f82b807fb81b3f87213ea96bf (patch) | |
tree | 4a7e3e95749d0b0dc6a2796a2fb3fa34875d163a /_deploy/wsl/localsettingsWSL.py | |
parent | 2c13c1b5f3d765017468e762082bc693df800278 (diff) | |
download | troggle-7f542b8936c6690f82b807fb81b3f87213ea96bf.tar.gz troggle-7f542b8936c6690f82b807fb81b3f87213ea96bf.tar.bz2 troggle-7f542b8936c6690f82b807fb81b3f87213ea96bf.zip |
LIBDIR automatically gets right python version
Diffstat (limited to '_deploy/wsl/localsettingsWSL.py')
-rw-r--r-- | _deploy/wsl/localsettingsWSL.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/_deploy/wsl/localsettingsWSL.py b/_deploy/wsl/localsettingsWSL.py index ac2fa2d..a74561c 100644 --- a/_deploy/wsl/localsettingsWSL.py +++ b/_deploy/wsl/localsettingsWSL.py @@ -15,6 +15,7 @@ a system-wide location rather than just a local directory. This file is included at the end of the main troggle/settings.py file so that it overwrites defaults in that file. +Read https://realpython.com/python-pathlib/ Read https://adamj.eu/tech/2020/03/16/use-pathlib-in-your-django-project/ """ @@ -37,19 +38,24 @@ EXPOFILESREMOTE = False # if True, then re-routes urls in expofiles to remote se SERVERPORT = '8000' # not needed +PV = "python" + str(sys.version_info.major) + "." + str(sys.version_info.minor) + +# Troggle does a lot of file-handling. This is very error-prone when using primitive methods, +# so we use pathlib which has been standard since python 3.4 +# If oathlib is new to you, you will need to read https://realpython.com/python-pathlib/ + # --------------------- MEDIA redirections BEGIN --------------------- -#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/t37/' -REPOS_ROOT_PATH = Path(__file__).parent.parent # We are assuming all 4 repos are siblings. -version = sys.version_info -#LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python{}.{}'.format(version.major, version.minor) # eg python 3.7 +REPOS_ROOT_PATH = Path(__file__).parent.parent +LIBDIR = REPOS_ROOT_PATH / 'lib' / PV +#LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.7' # should be finding this automatically: python --version etc. TROGGLE_PATH = Path(__file__).parent TEMPLATE_PATH = TROGGLE_PATH / 'templates' MEDIA_ROOT = TROGGLE_PATH / 'media' JSLIB_ROOT = TROGGLE_PATH / 'media' / 'jslib' # used for CaveViewer JS utility -FILES = Path('/mnt/c/EXPO/expofiles/') -EXPOFILES = Path('/mnt/c/EXPO/expofiles/') +FILES = Path('/mnt/f/expofiles/') +EXPOFILES = Path('/mnt/f/expofiles/') SURVEY_SCANS = EXPOFILES / 'surveyscans' PHOTOS_ROOT = EXPOFILES / 'photos' @@ -117,7 +123,7 @@ TEMPLATES = [ 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', # includes a variable MEDIA_URL - 'django.template.context_processors.static', # includes a variable STATIC_URL + 'django.template.context_processors.static', # includes a variable STATIC_URL used by admin pages 'django.template.context_processors.tz', 'django.template.context_processors.request', # must be enabled in DjangoTemplates (TEMPLATES) in order to use the admin navigation sidebar. 'django.contrib.messages.context_processors.messages', @@ -144,7 +150,6 @@ EMAIL_HOST_USER = "django-test@klebos.net" # Philip Sargent really EMAIL_PORT=587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = 'django-test@klebos.net' -EMAIL_SUBJECT_PREFIX = "[troggle]" SURVEX_DATA = REPOS_ROOT_PATH / "loser" DRAWINGS_DATA = REPOS_ROOT_PATH / "drawings" @@ -165,12 +170,10 @@ LOGFILE = os.fspath(LOGFILE) SURVEYS = os.fspath(SURVEYS) EXPOWEB = os.fspath(EXPOWEB) THREEDCACHEDIR = os.fspath(THREEDCACHEDIR) -DRAWINGS_DATA = os.fspath(DRAWINGS_DATA) +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) -JSLIB_ROOT = os.fspath(JSLIB_ROOT) -JSLIB_ROOT = os.fspath(JSLIB_ROOT) SURVEY_SCANS = os.fspath(SURVEY_SCANS) |