troggle-unchained/localsettingsserver.py

116 lines
4.1 KiB
Python
Raw Normal View History

2009-09-14 23:09:50 +01:00
import sys
2021-03-24 17:34:40 +00:00
import os
import urllib.parse
"""Settings for a troggle installation which may vary among different
installations: for development or deployment, in a docker image or
python virtual environment (venv), on ubuntu, debian or in Windows
System for Linux (WSL), on the main server or in the potato hut,
using SQLite or mariaDB.
2021-03-24 17:34:40 +00:00
It sets the directory locations for the major parts of the system so
that e.g. expofiles can be on a different filesystem.
2021-03-24 17:34:40 +00:00
This file is included at the end of the main troggle/settings.py file so that
it overwrites defaults in that file.
"""
print(" * importing troggle/localsettings.py")
# DO NOT check this file into the git repo - it contains real passwords.
DATABASES = {
2021-03-24 17:34:40 +00:00
'default': {
'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME' : 'troggle', # Or path to database file if using sqlite3.
'USER' : 'expo', # Not used with sqlite3.
'PASSWORD' : 'not a real password', # Not used with sqlite3.
'HOST' : '', # Set to empty string for localhost. Not used with sqlite3.
'PORT' : '', # Set to empty string for default. Not used with sqlite3.
}
}
2021-03-24 17:34:40 +00:00
EXPOUSER = 'expo'
EXPOUSERPASS = "nnn:gggggg"
EXPOUSER_EMAIL = 'wookey@wookware.org'
2021-03-24 17:34:40 +00:00
REPOS_ROOT_PATH = '/home/expo/'
sys.path.append(REPOS_ROOT_PATH)
sys.path.append(REPOS_ROOT_PATH + 'troggle')
2021-03-24 17:34:40 +00:00
# Define the path to the django app (troggle in this case)
PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
PYTHON_PATH + "templates"
],
'OPTIONS': {
'debug': 'DEBUG',
'context_processors': [
'django.contrib.auth.context_processors.auth',
'core.context.troggle_context',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# insert your TEMPLATE_LOADERS here
]
},
},
]
PUBLIC_SITE = True
2021-03-24 17:34:40 +00:00
# This should be False for normal running
DEBUG = True
SURVEX_DATA = REPOS_ROOT_PATH + 'loser/'
TUNNEL_DATA = REPOS_ROOT_PATH + 'tunneldata/'
CAVERN = 'cavern'
2021-03-24 17:34:40 +00:00
THREEDTOPOS = 'survexport'
EXPOWEB = REPOS_ROOT_PATH + 'expoweb/'
SURVEYS = REPOS_ROOT_PATH
2021-03-24 17:34:40 +00:00
SURVEY_SCANS = REPOS_ROOT_PATH + 'expofiles/surveyscans/'
FILES = REPOS_ROOT_PATH + 'expofiles'
2021-03-24 17:34:40 +00:00
CAVEDESCRIPTIONS = os.path.join(EXPOWEB, "cave_data")
ENTRANCEDESCRIPTIONS = os.path.join(EXPOWEB, "entrance_data")
2021-03-24 17:34:40 +00:00
CACHEDIR = REPOS_ROOT_PATH + 'expowebcache/'
THREEDCACHEDIR = CACHEDIR + '3d/'
THUMBNAILCACHE = CACHEDIR + 'thumbs'
PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/'
2021-03-24 17:34:40 +00:00
URL_ROOT = 'http://expo.survex.com/'
DIR_ROOT = ''#this should end in / if a value is given
2021-03-24 17:34:40 +00:00
EXPOWEB_URL = '/'
SURVEYS_URL = '/survey_scans/'
EXPOFILES = urllib.parse.urljoin(REPOS_ROOT_PATH, 'expofiles/')
PHOTOS_URL = urllib.parse.urljoin(URL_ROOT, '/photos/')
2021-03-31 21:51:17 +01:00
# MEDIA_URL is used by urls.py in a regex. See urls.py & core/views/surveys.py
2021-03-24 17:34:40 +00:00
MEDIA_URL = '/site_media/'
MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/'
2021-03-24 17:34:40 +00:00
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 ?
2009-09-14 23:09:50 +01:00
2021-03-24 17:34:40 +00:00
#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
2009-09-14 23:09:50 +01:00
2021-03-24 17:34:40 +00:00
LOGFILE = '/var/log/troggle/troggle.log'
IMPORTLOGFILE = '/var/log/troggle/import.log'
2009-09-14 23:09:50 +01:00
2021-03-24 17:34:40 +00:00
# add in 290, 291, 358 when they don't make it crash horribly
NOTABLECAVESHREFS = [ "264", "258", "204", "76", "107"]