-
Notifications
You must be signed in to change notification settings - Fork 0
/
siteSettings.py
674 lines (532 loc) · 29.7 KB
/
siteSettings.py
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#__END_LICENSE__
# siteSettings.py -- site default settings
#
# This contains the default settings for the site-level django app. This will
# override any application-default settings and define the default set of
# installed applications. This should be a full settings.py file which needs
# minimal overrides by the settings.py file for the application to actually
# function.
#
# As a bare minimum, please edit INSTALLED_APPS!
#
# This file *should* be checked into git.
import importlib
import os
import sys
import copy
from django.conf import global_settings
from django.core.urlresolvers import reverse
from geocamUtil.SettingsUtil import getOrCreateDict, getOrCreateArray, HOSTNAME
XGDS_SITE_APP = "xgds_subsea_app"
SITE_TITLE = 'SUBSEA' # the name of your research project, your brand
# Make this unique, and don't share it with anybody.
SECRET_KEY = '***REMOVED***'
FAVICON_PATH = "xgds_subsea/images/favicon.ico"
# from apps.basaltApp.instrumentDataImporters import *
# apps should be listed from "most specific" to "most general". that
# way, templates in more specific apps override ones from more general
# apps.
INSTALLED_APPS = ['django_npm_apps',
XGDS_SITE_APP,
# TODO uncomment the submodules that you are including
'xgds_sample',
'xgds_instrument',
'xgds_planner2',
'xgds_image',
'xgds_video',
'xgds_plot',
'xgds_status_board',
'xgds_notes2',
'xgds_map_server',
'deepzoom', # needed for xgds_image
'geocamTrack',
'xgds_timeseries',
'xgds_core',
'geocamPycroraptor2',
'geocamUtil',
'pipeline',
'taggit',
'resumable',
'django_markwhat',
'jsonify',
'dal',
'dal_select2',
'rest_framework.authtoken',
'rest_framework',
'corsheaders',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
]
for app in reversed(INSTALLED_APPS):
try:
appSettings = importlib.import_module(app + ".defaultSettings")
for key, val in vars(appSettings).iteritems():
if not key.startswith('_'):
globals()[key] = val
except:
pass
USING_DJANGO_DEV_SERVER = ('runserver' in sys.argv)
USE_STATIC_SERVE = USING_DJANGO_DEV_SERVER
SCRIPT_NAME = os.environ['DJANGO_SCRIPT_NAME'] # set in sourceme.sh
if USING_DJANGO_DEV_SERVER:
# django dev server deployment won't work with other SCRIPT_NAME settings
SCRIPT_NAME = '/'
DEBUG = True
# TEMPLATE_DEBUG was deprecated in Django 1.8 and moved inside TEMPLATES dictionary
TEMPLATE_DEBUG = DEBUG
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
if not PROJ_ROOT.endswith('/'):
PROJ_ROOT += '/'
# Python path is agnostic to what the site-level dir is. It also prefers the
# checked-out version of an app over the standard python install locations.
sys.path.append(PROJ_ROOT)
ADMINS = (
# ('NASA Intelligent Robotics Group', 'your_email@domain.com'),
)
MANAGERS = ADMINS
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Etc/UTC'
IMPORT_TIME_ZONE = 'utc'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-US'
SITE_ID = 1 # This is for Django's site framework - NOT to specify the location of a field site.
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# Absolute path to the directory that holds static.
# Example: "/home/static/static.lawrence.com/"
STATIC_ROOT = os.path.join(PROJ_ROOT, "build", "static")
# URL that handles the static served from STATIC_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://static.lawrence.com", "http://example.com/static/"
STATIC_URL = SCRIPT_NAME + 'static/'
EXTERNAL_URL = STATIC_URL
# Absolute path to the directory that holds data. This is different than static
# in that it's uploaded/processed data that's not needed for the operation of
# the site, but may need to be network-accessible, or be linked to from the
# database. Examples: images, generate kml files, etc.
# Example: "/data"
DATA_ROOT = os.path.join(PROJ_ROOT, 'data', '')
# URL that handles the data served from DATA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://data.lawrence.com", "http://example.com/data/"
DATA_URL = SCRIPT_NAME + 'data/'
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = DATA_ROOT
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = DATA_URL
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(PROJ_ROOT, 'apps', XGDS_SITE_APP, 'templates'),
os.path.join(PROJ_ROOT, 'apps', XGDS_SITE_APP, 'templates', XGDS_SITE_APP),
os.path.join(PROJ_ROOT, 'apps/xgds_core/templates/registration'),
STATIC_ROOT,
# Templates for utility scripts
os.path.join(PROJ_ROOT, 'bin/templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'debug': True,
'context_processors': ['django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'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',
'geocamUtil.context_processors.settings',
'geocamUtil.context_processors.AuthUrlsContextProcessor.AuthUrlsContextProcessor',
'geocamUtil.context_processors.SettingsContextProcessor.SettingsContextProcessor'
],
},
},
]
# Session Serializer: we use Pickle for backward compatibility and to allow more flexible session storage, but
# be sure to keep the SECRET_KEY secret for security (see:
# https://docs.djangoproject.com/en/1.7/topics/http/sessions/#session-serialization)
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
# List of callables that know how to import templates from various sources.
# TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
# 'django.template.loaders.app_directories.Loader',
# # 'django.template.loaders.eggs.load_template_source',
# )
MIDDLEWARE_CLASSES = (
'geocamUtil.middleware.LogErrorsMiddleware',
'django.middleware.gzip.GZipMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.RemoteUserMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.RemoteUserBackend',
'django.contrib.auth.backends.ModelBackend'
]
ROOT_URLCONF = 'urls'
#TODO probably can delete the below 2 lines
LOGIN_URL = SCRIPT_NAME + 'accounts/login/'
LOGIN_REDIRECT_URL = '/'
# email settings
# EMAIL_HOST="email.arc.nasa.gov"
# EMAIL_PORT=25
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/xgds_messages'
EMAIL_SUBJECT_PREFIX = '[xGDS] '
SERVER_EMAIL = 'noreply@xgds.org'
# MANAGERS = (
# # Addresses listed here will get notification when a new user requests an account
# ('First Last', 'username@sample.com'),
# )
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.FileSystemFinder',
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
'pipeline.finders.CachedFileFinder',
'djangobower.finders.BowerFinder',
'django_npm_apps.finders.NpmAppFinder',
)
# SET UP PIPELINE
PIPELINE = getOrCreateDict('PIPELINE')
PIPELINE['PIPELINE_ENABLED'] = True
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.yuglify.YuglifyCompressor'
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.yuglify.YuglifyCompressor'
PIPELINE['YUGLIFY_JS_ARGUMENTS'] = 'mangle:false --terminal'
PIPELINE['DISABLE_WRAPPER'] = True
COMPRESS_ENABLED = False # TODO this does not yet work for some reason
#COMPRESS_CSSTIDY_BINARY = '/usr/bin/csstidy'
# PIPELINE_COMPILERS = ()
DEBUG_TOOLBAR = False
if DEBUG_TOOLBAR:
INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES_LIST = list(MIDDLEWARE_CLASSES)
MIDDLEWARE_CLASSES_LIST.insert(2, 'debug_toolbar.middleware.DebugToolbarMiddleware')
MIDDLEWARE_CLASSES = tuple(MIDDLEWARE_CLASSES_LIST)
INTERNAL_IPS = ('127.0.0.1',
'10.0.3.1',
'::1') # TODO add your virtual machine's IP here from your host;
#ie do an ifconfig and see if virtualbox or vmware has created something.
# Alternately you can create a view that returns request.META['REMOTE_ADDR']
DEBUG_TOOLBAR_PANELS = ['debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
#'debug_toolbar.panels.profiling.ProfilingPanel',
]
DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False,
'RENDER_PANELS': True,
'JQUERY_URL': '',
}
VAR_ROOT = PROJ_ROOT + 'var/'
GEOCAM_TRACK_OPS_TIME_ZONE = TIME_ZONE
GEOCAM_TRACK_POSITION_MODEL = 'geocamTrack.ResourcePoseDepth'
GEOCAM_TRACK_PAST_POSITION_MODEL = 'geocamTrack.PastResourcePoseDepth'
GEOCAM_TRACK_CLOSEST_POSITION_MAX_DIFFERENCE_SECONDS = 2
GEOCAM_TRACK_START_NEW_LINE_DISTANCE_METERS = 11
GEOCAM_TRACK_HEADING_UNITS = 'degrees'
GEOCAM_TRACK_HIDE_TRACKS = ['Hercules', 'Argus', 'Nautilus', 'Herc'] # we do not know why herc is even in there
GEOCAM_TRACK_PRELOAD_TRACK_IMAGES = ["/static/geocamTrack/icons/hercules_pointer.png",
"/static/geocamTrack/icons/argus_pointer.png",
"/static/geocamTrack/icons/nautilus_pointer.png",
"/static/geocamTrack/icons/hercules_circle.png",
"/static/geocamTrack/icons/argus_circle.png",
"/static/geocamTrack/icons/nautilus_circle.png",
"/static/geocamTrack/icons/hercules_stop.png",
"/static/geocamTrack/icons/argus_stop.png",
"/static/geocamTrack/icons/nautilus_stop.png"]
COMPASS_EQUIPPED_VEHICLES = []
# FOR HI IT IS
COMPASS_CORRECTION = 10
# Update this if you are using xgds_sample, to put a permanent link in the qr codes to a url.
XGDS_SAMPLE_PERM_LINK_PREFIX = "https://subsea.xgds.org"
XGDS_INSTRUMENT_IMPORT_MODULE_PATH = 'xgds_subsea_app.instrumentDataImporters'
# XGDS_VIDEO_GET_ACTIVE_EPISODE = 'xgds_baseline_app.views.getActiveEpisode'
# XGDS_VIDEO_GET_EPISODE_FROM_NAME = 'xgds_baseline_app.views.getEpisodeFromName'
# XGDS_VIDEO_GET_TIMEZONE_FROM_NAME = 'xgds_baseline_app.views.getTimezoneFromFlightName'
# XGDS_VIDEO_INDEX_FILE_METHOD = 'xgds_baseline_app.views.getIndexFileSuffix'
# XGDS_VIDEO_DELAY_AMOUNT_METHOD = 'xgds_baseline_app.views.getDelaySeconds'
# XGDS_VIDEO_NOTE_EXTRAS_FUNCTION = 'xgds_baseline_app.views.getNoteExtras'
# XGDS_VIDEO_NOTE_FILTER_FUNCTION = 'xgds_baseline_app.views.noteFilterFunction'
XGDS_VIDEO_RECORDING_LAG_SECONDS = 40
XGDS_VIDEO_SEGMENT_START_TIME_OFFSET_SECONDS = XGDS_VIDEO_RECORDING_LAG_SECONDS - 1
XGDS_VIDEO_EXPECTED_CHUNK_DURATION_SECONDS = 10
RECORDED_VIDEO_DIR_BASE = DATA_ROOT
RECORDED_VIDEO_URL_BASE = DATA_URL
PYRAPTORD_SERVICE = True
XGDS_CURRENT_SITEFRAME_ID = 3 # Currently GORDA RIDGE
XGDS_CORE_LIVE_INDEX_URL = '/' + XGDS_SITE_APP + '/live'
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
def make_key(key, key_prefix, version):
return key
FILE_UPLOAD_TEMP_DIR = os.path.join(DATA_ROOT, XGDS_MAP_SERVER_GEOTIFF_SUBDIR, 'temp')
ZEROMQ_PORTS = PROJ_ROOT + 'apps/xgds_subsea_app/ports.json'
USE_TZ = True
# turn this on when we are live field broadcasting
GEOCAM_UTIL_LIVE_MODE = False
GEOCAM_UTIL_DATATABLES_EDITOR = False
GEOCAM_TRACK_URL_PORT = 8181
# must be also set up in geoserver
GEOSERVER_DEFAULT_WORKSPACE = 'xgds_subsea'
# While you are modifying handlebars templates, this should be true. Once they have been loaded
# once they will be cached and you can set this to false.
XGDS_CORE_TEMPLATE_DEBUG = True
JWPLAYER_KEY = '***REMOVED***'
ALLOWED_HOSTS = ['*']
# Setup support for proxy headers
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
]
}
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 43200 # 12 hours
XGDS_PLANNER_PLAN_EXPORTERS = (
('xpjson', '.json', 'xgds_planner2.planExporter.XpjsonPlanExporter'),
('bearing_distance', '.bdj', 'xgds_planner2.planExporter.BearingDistanceJsonPlanExporter'),
('kml', '.kml', 'xgds_planner2.kmlPlanExporter.KmlPlanExporter'),
# ('stats', '-stats.json', 'xgds_planner2.statsPlanExporter.StatsPlanExporter'),
('tgt', '.tgt', 'xgds_subsea_app.tgtPlanExporter.TgtPlanExporter'),
('lnw', '.lnw', 'xgds_subsea_app.linePlanExporter.LinePlanExporter'),
)
XGDS_PLANNER_PLAN_BEARING_HANDLEBAR_PATH = 'xgds_subsea_app/templates/xgds_planner2/bearingDistancePlan.handlebars'
XGDS_CORE_FLIGHT_MONIKER = "Dive"
XGDS_CORE_GROUP_FLIGHT_MONIKER = "Dive"
XGDS_CORE_DEFAULT_VEHICLE_PK = 2 # Hercules
XGDS_NOTES_MODEL_NAME = 'Event'
XGDS_NOTES_NOTE_MONIKER = 'Event'
XGDS_NOTES_MONIKER = 'Event Log'
XGDS_NOTES_MESSAGES_MONIKER = 'Science Chat'
XGDS_NOTES_SHOW_ON_MAP_CHECKBOX = False
XGDS_IMAGE_IMAGE_SET_MONIKER = 'Image'
XGDS_IMAGE_IMAGE_MODEL_NAME = 'Image'
XGDS_IMAGE_DEEPZOOM_THREAD = False
XGDS_MAP_SERVER_SITE_MONIKER = 'Region'
XGDS_MAP_SERVER_PLACE_MONIKER = 'Site'
XGDS_PLANNER_PLAN_MONIKER = "ROV Plan"
XGDS_PLANNER_STATION_MONIKER = "Target"
XGDS_PLANNER_STATION_MONIKER_PLURAL = XGDS_PLANNER_STATION_MONIKER + 's'
XGDS_PLANNER_SEGMENT_MONIKER = "Segment"
XGDS_PLANNER_COMMAND_MONIKER = "Activity"
XGDS_PLANNER_COMMAND_MONIKER_PLURAL = "Activities"
XGDS_PLANNER_SCHEMAS["Hercules"] = { "schemaSource": "apps/xgds_subsea_app/planner/HerculesPlanSchema.json",
"librarySource": "apps/xgds_subsea_app/planner/HerculesPlanLibrary.json",
"simulatorUrl": "xgds_planner2/js/planner/genericVehicleSimulator.js",
"simulator": "genericVehicle.Simulator", # the namespace within the simulator js
}
XGDS_MAP_SERVER_JS_MAP = getOrCreateDict('XGDS_MAP_SERVER_JS_MAP')
XGDS_NOTES_NOTE_MODEL = 'xgds_notes2.LocatedNote'
XGDS_MAP_SERVER_JS_MAP[XGDS_NOTES_MODEL_NAME] = {'ol': 'xgds_notes2/js/olNoteMap.js',
'model': XGDS_NOTES_NOTE_MODEL,
'columns': ['checkbox', 'event_time', 'author_name', 'content', 'tag_names', 'content_url', 'content_thumbnail_url', 'content_name', 'app_label', 'model_type', 'type', 'lat', 'lon', 'alt', 'depth', 'flight_name', 'object_type', 'object_id', 'creation_time','show_on_map', 'role_name', 'location_name', 'event_timezone', 'pk'],
'hiddenColumns': ['app_label', 'model_type', 'type', 'event_timezone', 'lat', 'lon', 'alt', 'depth', 'role_name', 'location_name', 'flight_name', 'content_thumbnail_url', 'content_name', 'object_type', 'object_id', 'creation_time','show_on_map','pk'],
'searchableColumns': ['name', 'description', 'flight_name', 'author_name', 'role_name', 'location_name',],
'editableColumns': {'content': 'text', 'tag_names': 'tagsinput'},
'unsortableColumns': ['content_url'],
'columnTitles': ['Time', 'Author', 'Content', 'Tags', 'Link'],
'order_columns': ['pk', 'event_time', 'author__first_name', 'content', 'tags'],
'viewHandlebars': 'xgds_subsea_app/templates/handlebars/note-view.handlebars',
'viewJS': [STATIC_URL + 'xgds_notes2/js/genericNotesView.js' ],
'viewInitMethods': ['xgds_notes.initDetailView'],
'searchInitMethods': ['xgds_notes.initializeInput'],
'event_time_field': 'event_time',
'event_timezone_field': 'event_timezone',
'search_form_class': 'xgds_notes2.forms.SearchNoteForm'}
XGDS_NOTES_MESSAGE_MODEL_NAME = 'Message' # used for building filters
XGDS_NOTES_MESSAGE_MODEL = 'xgds_notes2.LocatedMessage'
XGDS_MAP_SERVER_JS_MAP[XGDS_NOTES_MESSAGE_MODEL_NAME] = {'ol': 'xgds_notes2/js/olMessageMap.js',
'model': XGDS_NOTES_MESSAGE_MODEL,
'columns': ['checkbox', 'event_time', 'author_name', 'content', 'lat', 'lon', 'alt', 'depth', 'flight_name', 'app_label', 'model_type', 'type', 'event_timezone', 'pk'],
'hiddenColumns': ['app_label', 'model_type', 'type', 'lat', 'lon', 'alt', 'depth', 'flight_name', 'event_timezone', 'pk'],
'searchableColumns': ['content', 'flight_name', 'author_name', ],
'editableColumns': {'content': 'text'},
'columnTitles': ['Time', 'Author', 'Content'],
'order_columns': ['pk', 'event_time', 'author__first_name', 'content'],
'columnWidths': ['5px', '50px', '50px', 'auto'],
'viewHandlebars': 'xgds_subsea_app/templates/handlebars/message-view.handlebars',
'event_time_field': 'event_time',
'event_timezone_field': 'event_timezone',
'search_form_class': 'xgds_notes2.forms.SearchMessageForm'}
XGDS_MAP_SERVER_JS_MAP[XGDS_SAMPLE_SAMPLE_KEY] = {'ol': 'xgds_sample/js/olSampleMap.js',
'model': XGDS_SAMPLE_SAMPLE_MODEL,
'searchableColumns': ['name','description','flight_name', 'sample_type', 'extras'],
'columns': ['checkbox', 'collection_time', 'name', 'sample_type_name', 'place_name', 'label_number', 'collector_name', 'vehicle_name', 'thumbnail_image_url', 'pk', 'lat', 'lon', 'alt', 'depth', 'flight_name', 'app_label', 'model_type', 'type', 'description', 'collection_timezone', 'extras', 'DT_RowId'],
'hiddenColumns': ['thumbnail_image_url', 'collection_timezone', 'pk', 'lat', 'lon', 'alt', 'depth', 'label_number', 'collector_name', 'flight_name', 'vehicle_name', 'app_label', 'model_type', 'type', 'description', 'extras', 'DT_RowId'],
'columnTitles': ['Time', 'ID', 'Type', 'Site'],
'order_columns': ['pk', 'collection_time', 'name', 'sample_type__display_name', 'place__name'],
'viewHandlebars': 'xgds_subsea_app/templates/handlebars/sample-view.handlebars',
'event_time_field': 'collection_time',
'event_timezone_field': 'collection_timezone',
'search_form_class': 'xgds_sample.forms.SearchSampleForm',
}
if 'Note' in XGDS_MAP_SERVER_JS_MAP:
del XGDS_MAP_SERVER_JS_MAP['Note']
if 'Photo' in XGDS_MAP_SERVER_JS_MAP:
photo_dict = XGDS_MAP_SERVER_JS_MAP['Photo']
XGDS_MAP_SERVER_JS_MAP[XGDS_IMAGE_IMAGE_MODEL_NAME] = photo_dict
del XGDS_MAP_SERVER_JS_MAP['Photo']
photo_dict['viewHandlebars'] = 'xgds_subsea_app/templates/handlebars/image-view2.handlebars'
photo_dict['columns'] = ['checkbox', 'acquisition_time', 'author_name', 'name', 'description',
'thumbnail_image_url', 'pk', 'view_url',
'camera_name', 'raw_image_url', 'app_label', 'model_type', 'type', 'lat', 'lon', 'alt', 'head',
'flight_name', 'deepzoom_file_url',
'rotation_degrees', 'originalImageResolutionString', 'originalImageFileSizeMB', 'create_deepzoom',
'vehicle_name', 'acquisition_timezone', 'depth', 'DT_RowId']
photo_dict['hiddenColumns'] = ['pk', 'view_url', 'camera_name', 'raw_image_url', 'app_label', 'vehicle_name', 'model_type', 'type',
'lat', 'lon', 'alt', 'head', 'flight_name', 'deepzoom_file_url', 'rotation_degrees',
'originalImageResolutionString', 'originalImageFileSizeMB', 'create_deepzoom', 'acquisition_timezone', 'depth', 'DT_RowId']
photo_dict['columnTitles'] = ['Time', 'Author', 'Name', 'Description', 'Image']
photo_dict['order_columns'] = ['pk', 'acquisition_time', 'author__first_name', 'name', 'description']
XGDS_MAP_SERVER_JS_MAP['Position'] = {'ol': 'geocamTrack/js/olPositionMap.js',
'model': GEOCAM_TRACK_PAST_POSITION_MODEL,
'columns': ['timestamp', 'lat', 'lon', 'altitude', 'heading', 'depth', 'pk', 'app_label', 'model_type', 'track_name','track_pk', 'displayName', 'DT_RowId'],
'hiddenColumns': ['pk', 'app_label', 'model_type', 'track_pk', 'displayName', 'DT_RowId'],
'columnTitles': ['Time', 'TZ', 'Latitude', 'Longitude', 'Altitude', 'Heading', 'Depth', 'Track', ''],
'searchableColumns': ['timestamp', 'lat', 'lon', 'altitude', 'heading', 'depth', 'track_name'],
'search_form_class': 'geocamTrack.forms.SearchPositionForm',
'coords_array_order': ['lon', 'lat', 'altitude', 'heading', 'pitch', 'roll', 'depth']}
XGDS_MAP_SERVER_SEARCH_MODELS = ['Event', 'Sample', 'Image', 'Message']
XGDS_CORE_SHOW_CREATE_FLIGHTS = False
XGDS_CORE_SHOW_FLIGHT_MANAGEMENT = False
XGDS_CORE_ADD_GROUP_FLIGHT = False
CRUISE_ID = 'NA108'
DIVE_MODE = 2 # 1 OR 2, controls chat links
XGDS_MAP_SERVER_REPLAY_HANDLEBARS_DIRS = [os.path.join('xgds_map_server', 'templates', 'handlebars'),
os.path.join('xgds_map_server', 'templates', 'handlebars', 'search'),
os.path.join('xgds_map_server', 'templates', 'handlebars', 'replay'),
os.path.join('xgds_subsea_app', 'templates', 'handlebars', 'replay')]
COUCHDB_URL = "http://couchdb:5984"
COUCHDB_FILESTORE_NAME = "subsea-file-store" # you may want to customize this to be something like yoursite-file-store
# this is a hack for right now; really instead of 'today' it should be 'current dive'
XGDS_MAP_SERVER_DEFAULT_HOURS_RANGE = 16
# If you are not running in docker-compose for some reason, remove the below
XGDS_CORE_IMPORT_URL_PREFIX = 'nginx'
XGDS_DATA_IMPORTS = getOrCreateDict('XGDS_DATA_IMPORTS')
if 'Photos' in XGDS_DATA_IMPORTS:
del XGDS_DATA_IMPORTS['Photos']
XGDS_DATA_IMPORTS[XGDS_IMAGE_IMAGE_SET_MONIKER + 's'] = '/xgds_image/import'
if 'GPS Track' in XGDS_DATA_IMPORTS:
del XGDS_DATA_IMPORTS['GPS Track']
if 'Notes' in XGDS_DATA_IMPORTS:
del XGDS_DATA_IMPORTS['Notes']
if 'Science Instruments' in XGDS_DATA_IMPORTS:
del XGDS_DATA_IMPORTS['Science Instruments']
XGDS_VIDEO_DEFAULT_AUDIO_SOURCE = "Hercules"
XGDS_VIDEO_INDEX_FILE_NAME = "playlist.m3u8" # for vlc use prog_index.m3u8"
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
]
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'xgds_core.password_validation.SpecialCharsValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
}
]
XGDS_SSE_TRACK_CHANNELS = ['hercules', 'argus', 'nautilus']
XGDS_NOTES_NOTE_SSE_TYPE = XGDS_NOTES_NOTE_MONIKER
XGDS_NOTES_MESSAGE_SSE_TYPE = 'message'
XGDS_SSE_NOTE_CHANNELS = ['sse', 'hercules']
XGDS_SSE_NOTE_MESSAGE_CHANNELS = ['sse', 'hercules']
XGDS_SSE_IMAGE_CHANNELS = ['sse', 'hercules', 'argus', 'sat3']
XGDS_IMAGE_SSE_TYPE = XGDS_IMAGE_IMAGE_MODEL_NAME
XGDS_SSE_SAMPLE_CHANNELS = ['sse', 'hercules']
XGDS_SSE_CHANNELS = ['sse', 'hercules', 'argus', 'nautilus', 'sat3']
XGDS_CORE_REDIS = True
# if you are NOT running in docker-compose, put the following in your settings.py:
# XGDS_CORE_REDIS_HOST = "localhost"
# CACHES = {
# 'default': {
# 'BACKEND': 'redis_cache.RedisCache',
# 'LOCATION': 'localhost:6379',
# 'TIMEOUT': 604800,
# 'KEY_FUNCTION': make_key
# },
# }
XGDS_CORE_REDIS_HOST = "redis"
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '%s:6379' % XGDS_CORE_REDIS_HOST,
'TIMEOUT': 604800,
"OPTIONS": {
"CONNECTION_POOL_KWARGS": {"max_connections": 256, "retry_on_timeout": True, "socket_keepalive": True}
},
'KEY_FUNCTION': make_key
},
}
XGDS_CORE_DEFAULT_GROUP_FLIGHT_DURATION_HOURS = 18
XGDS_CORE_LIVE_INDEX_URL = '/xgds_subsea_app/live'
CONN_MAX_AGE = 30
# override these in settings.py
NAUTILUS_CHAT_URL = ''
NAUTILUS_CHAT_AUTOJOIN = ''
GEOCAM_UTIL_LIVE_MODE = True
XGDS_SSE = True
XGDS_MAP_SERVER_TYPE_CLASS_MAP = {'Image': 'Photo'}