summaryrefslogtreecommitdiffstats
path: root/localsettingsWSL.py
blob: 01133ba1d8d3e456043f1e59ddce1976bb6f197a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import sys
import os
import urllib.parse

# link 'localsettings.py' to localsettingsWSL.py for use on a Windows 10 machine running WSL1
print(" * importing troggle/localsettings.py")

#-----------------------------------------------------------------
#  THINK before you push this to a repo
#  - have you checked that this file is in .gitignore ?
#  - have you run pre-push.sh to copy files and remove passwords?
#  - we don't want to have to change the expo system password !
#-----------------------------------------------------------------

SERVERPORT = '3777'

LIBDIR =   '/mnt/d/CUCC-Expo/t37/lib/python3.7/'
#LIBDIR  = '/mnt/d/CUCC-Expo/deb37/lib/python3.7/'
#LIBDIR  = '/mnt/d/CUCC-Expo/t38/lib/python3.8/'
#LIBDIR  = '/usr/lib/python3.8/'

REPOS_ROOT_PATH  = '/mnt/d/CUCC-Expo/t37/'
#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/t38/'
#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/deb37/'
#REPOS_ROOT_PATH = '/mnt/d/CUCC-Expo/'

MEDIA_ROOT = REPOS_ROOT_PATH + 'troggle/media/'
#MEDIA_URL = urllib.parse.urljoin(URL_ROOT , '/site_media/')
MEDIA_URL = '/site_media/'

#STATIC_ROOT removed after merging content into MEDIA_ROOT. See urls.py & core/views_surveys.py

PUBLIC_SITE = False
DEBUG = True

# executables:
CAVERN = 'cavern'
THREEDTOPOS = '3dtopos'

DATABASES = {
    'default': { 
        'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME' : 'troggle.sqlite',
#        'NAME' : ':memory:',
        'USER' : 'expo',        # Not used with sqlite3.
        'PASSWORD' : 'sekrit',  # 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.
    }
}
# add in 290, 291, 358 when they don't make it crash horribly
NOTABLECAVESHREFS = [ "264", "258", "204", "76", "107"]

sys.path.append(REPOS_ROOT_PATH)
sys.path.append(REPOS_ROOT_PATH + 'troggle')
PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/'

LOGFILE = PYTHON_PATH + 'troggle.log'

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
           ]
       },
    },
]

EXPOUSER = 'expo'
EXPOUSERPASS = "nnn:gggggg"
EXPOUSER_EMAIL = 'philip.sargent@gmail.com'

EMAIL_HOST = "smtp.gmail.com"
EMAIL_HOST_USER = "philip.sargent@gmail.com"
EMAIL_HOST_PASSWORD = "insert-real-email-password-here"
EMAIL_PORT=587
EMAIL_USE_TLS = True

SURVEX_DATA = REPOS_ROOT_PATH + 'loser/'
TUNNEL_DATA = REPOS_ROOT_PATH + 'drawings/'
THREEDCACHEDIR = REPOS_ROOT_PATH + 'expowebcache/3d/'

EXPOWEB = REPOS_ROOT_PATH + 'expoweb/'
SURVEYS = REPOS_ROOT_PATH
SURVEY_SCANS = '/mnt/f/expofiles/surveyscans/'
FILES = '/mnt/f/expofiles/'
CAVEDESCRIPTIONS = os.path.join(EXPOWEB, "cave_data")
ENTRANCEDESCRIPTIONS = os.path.join(EXPOWEB, "entrance_data")
EXPOWEB_URL = ''
SURVEYS_URL = '/survey_scans/'
EXPOFILES ='/mnt/f/expofiles/'

URL_ROOT = 'http://localhost:'+ SERVERPORT +'/'
DIR_ROOT = ''#this should end in / if a value is given

SURVEYS_URL = urllib.parse.urljoin(URL_ROOT , '/survey_scans/')
PHOTOS_URL  = urllib.parse.urljoin(URL_ROOT , '/photos/')
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 ?

print(" + finished importing troggle/localsettings.py")