forked from expo/troggle
LIBDIR automatically gets right python version
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user