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

survex_file field inconsistency detection & edit

This commit is contained in:
Philip Sargent
2021-04-02 23:21:23 +01:00
parent bd8d59b343
commit 52c1dabd0e
7 changed files with 120 additions and 47 deletions

View File

@@ -9,7 +9,8 @@ System for Linux (WSL), on the main server or in the potato hut,
using SQLite or mariaDB.
It sets the directory locations for the major parts of the system so
that e.g. expofiles can be on a different filesystem.
that e.g. expofiles can be on a different filesystem, or /javascript/ can be in
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.
@@ -22,24 +23,26 @@ print(" * importing troggle/localsettings.py")
# - have you checked that credentials.py is in .gitignore ?
# - we don't want to have to change the expo system password !
#-----------------------------------------------------------------
# default values, then get overwritten by real secrets
# default values, then get overwritten by real secrets imported from credentials.py
EXPOUSERPASS = "nnn:gggggg"
EMAIL_HOST_PASSWORD = "insert-real-email-password-here"
from credentials import EXPOUSERPASS
from credentials import EMAIL_HOST_PASSWORD
SERVERPORT = '8000'
EXPOFILESREMOTE = False # if True, then re-routes urls in expofiles to remote sever. Tests are then less accurate.
#SECURE_SSL_REDIRECT = True # breaks 7 tests in test suite 301 not 200 (or 302) and runserver fails completely
SERVERPORT = '8000' # not needed
# --------------------- MEDIA redirections BEGIN ---------------------
#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/t37/'
REPOS_ROOT_PATH = Path(__file__).parent.parent
LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.7'
LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.7' # should be finding this automatically: python --version etc.
TROGGLE_PATH = Path(__file__).parent
TEMPLATE_PATH = os.fspath(TROGGLE_PATH / 'templates')
MEDIA_ROOT = os.fspath(TROGGLE_PATH / 'media')
TEMPLATE_PATH = TROGGLE_PATH / 'templates'
MEDIA_ROOT = TROGGLE_PATH / 'media'
JSLIB_ROOT = TROGGLE_PATH / 'media' / 'jslib' # used for CaveViewer JS utility
FILES = Path('/mnt/f/expofiles/')
EXPOFILES = Path('/mnt/f/expofiles/')
@@ -52,7 +55,7 @@ MEDIA_URL = '/site-media/'
DIR_ROOT = ''#this should end in / if a value is given
URL_ROOT = '/'
URL_ROOT = 'http://localhost:'+ SERVERPORT +'/'
# URL_ROOT = 'http://localhost:'+ SERVERPORT +'/'
MEDIA_URL = urllib.parse.urljoin(URL_ROOT , '/site_media/')
SURVEYS_URL = urllib.parse.urljoin(URL_ROOT , '/survey_scans/')
@@ -61,7 +64,7 @@ SVX_URL = urllib.parse.urljoin(URL_ROOT , '/survex/')
STATIC_URL = urllib.parse.urljoin(URL_ROOT , '/static/') # used by Django admin pages. Do not delete.
JSLIB_URL = urllib.parse.urljoin(URL_ROOT , '/javascript/') # always fails, try to revive it ?
JSLIB_URL = urllib.parse.urljoin(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 ---------------------
@@ -115,21 +118,22 @@ TEMPLATES = [
'django.contrib.messages.context_processors.messages',
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', #For each app, inc admin, in INSTALLED_APPS, loader looks for /templates
# insert your own TEMPLATE_LOADERS here
'django.template.loaders.filesystem.Loader', # default lcation is troggle/templates/
'django.template.loaders.app_directories.Loader', # needed for admin 'app'
]
},
},
]
# Passwords are loaded from credentials.py by settings.py
EXPOUSERPASS = "nnn:gggggg" # overwritten by loading from credentials.py
EMAIL_HOST_PASSWORD = "insert-real-email-password-here" # overwritten by loading from credentials.py
EXPOUSER = 'expo'
# EXPOUSERPASS = "nnn:gggggg" # loaded from credentials.py
EXPOUSER_EMAIL = 'philip.sargent@gmail.com'
EMAIL_HOST = "smtp-auth.mythic-beasts.com"
EMAIL_HOST_USER = "django-test@klebos.net" # Philip Sargent really
# EMAIL_HOST_PASSWORD = "insert-real-email-password-here" # loaded from credentials.py
EMAIL_PORT=587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'django-test@klebos.net'
@@ -152,8 +156,12 @@ ENTRANCEDESCRIPTIONS = os.fspath(ENTRANCEDESCRIPTIONS)
LOGFILE = os.fspath(LOGFILE)
SURVEYS = os.fspath(SURVEYS)
EXPOWEB = os.fspath(EXPOWEB)
THREEDCACHEDIR = os.fspath(THREEDCACHEDIR)
TUNNEL_DATA = os.fspath(TUNNEL_DATA)
SURVEX_DATA = os.fspath(SURVEX_DATA)
THREEDCACHEDIR = os.fspath(THREEDCACHEDIR)
TUNNEL_DATA = os.fspath(TUNNEL_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)
print(" + finished importing troggle/localsettings.py")