-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
443 lines (377 loc) · 12.2 KB
/
settings.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
# -*- coding: utf-8 -*-
# Django settings for GeoNode project.
from urllib import urlencode
import os
import geonode
_ = lambda x: x
DEBUG = True
SITENAME = "TsuDAT"
SITEURL="http://203.77.224.69/"
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
GEONODE_ROOT = os.path.dirname(geonode.__file__)
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'django.contrib.gis.db.backends.postgis'
DATABASE_NAME = 'tsudat'
DATABASE_USER = 'tsdat' # Not used with sqlite3.
DATABASE_PASSWORD = 'secret' # Not used with sqlite3.
DATABASE_HOST = '' # Not used with sqlite3.
DATABASE_PORT = '' # Not used with sqlite3.
# 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 = 'Australia/Sydney'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'English'),
('id', 'Bahasa Indonesia'),
)
SITE_ID = 1
# Setting a custom test runner to avoid running the tests for some problematic 3rd party apps
TEST_RUNNER='geonode.testrunner.GeoNodeTestRunner'
NOSE_ARGS = [
'--verbosity=2',
'--cover-erase',
'--nocapture',
'--with-coverage',
'--cover-package=geonode',
'--cover-inclusive',
'--cover-tests',
'--detailed-errors',
'--with-xunit',
# This is very beautiful/usable but requires: pip install rudolf
# '--with-color',
# The settings below are useful while debugging test failures or errors
# '--failed',
# '--pdb-failures',
# '--stop',
# '--pdb',
]
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
MEDIA_ROOT = '/var/www/geonode/uploaded'
MEDIA_URL = '/uploaded/'
STATIC_ROOT = '/var/www/geonode/static/'
STATIC_URL = '/static/'
GEONODE_UPLOAD_PATH = MEDIA_ROOT + 'geonode'
GEONODE_CLIENT_LOCATION = STATIC_URL + 'geonode/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
# Additional directories which hold static files
STATICFILES_DIRS = [
os.path.join(PROJECT_ROOT, "media"),
os.path.join(GEONODE_ROOT, 'media'),
'/etc/geonode/media',
]
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'myv-y4#7j-d*p-__@j#*3z@!y24fz8%^z2v6atuy4bo9vqr1_a'
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
# The context processor belows add things like SITEURL
# and GEOSERVER_BASE_URL to all pages that use a RequestContext
'geonode.context_processors.resource_urls',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# The setting below makes it possible to serve different languages per
# user depending on things like headers in HTTP requests.
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
# This isn't required for running the geonode site, but it when running sites that inherit the geonode.settings module.
LOCALE_PATHS = (
os.path.join(PROJECT_ROOT, "locale"),
os.path.join(PROJECT_ROOT, "maps", "locale"),
)
ROOT_URLCONF = 'tsudat2.urls'
# Note that Django automatically includes the "templates" dir in all the
# INSTALLED_APPS, se there is no need to add maps/templates or admin/templates
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates'),
os.path.join(GEONODE_ROOT, 'templates'),
'/etc/geonode/templates',
)
# The FULLY QUALIFIED url to the GeoServer instance for this GeoNode.
GEOSERVER_BASE_URL = SITEURL + 'geoserver/'
# Default password for the geoserver admin user, autogenerated during bootstrap
GEOSERVER_TOKEN = open('/var/lib/geonode/geoserver_token')
# The username and password for a user that can add and edit layer details on GeoServer
GEOSERVER_CREDENTIALS = "geoserver_admin", GEOSERVER_TOKEN
AUTHENTICATION_BACKENDS = ('geonode.security.auth.GranularBackend',)
# CSW settings
CATALOGUE = {
'default': {
# The underlying CSW implementation
# default is pycsw in local mode (tied directly to GeoNode Django DB)
'ENGINE': 'geonode.catalogue.backends.pycsw_local',
# pycsw in non-local mode
#'ENGINE': 'geonode.catalogue.backends.pycsw',
# GeoNetwork opensource
#'ENGINE': 'geonode.catalogue.backends.geonetwork',
# deegree and others
#'ENGINE': 'geonode.catalogue.backends.generic',
# The FULLY QUALIFIED base url to the CSW instance for this GeoNode
'URL': '%scatalogue/csw' % SITEURL,
#'URL': 'http://localhost:8080/geonetwork/srv/en/csw',
#'URL': 'http://localhost:8080/deegree-csw-demo-3.0.4/services',
# login credentials (for GeoNetwork)
'USER': 'admin',
'PASSWORD': 'admin',
}
}
# pycsw settings
PYCSW = {
# pycsw configuration
'CONFIGURATION': {
'metadata:main': {
'identification_title': '%s Catalogue' % SITENAME,
'identification_abstract': 'GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data',
'identification_keywords': '%s,sdi,catalogue,discovery,metadata,GeoNode' % SITENAME,
'identification_keywords_type': 'theme',
'identification_fees': 'None',
'identification_accessconstraints': 'None',
'provider_name': 'Organization Name',
'provider_url': SITEURL,
'contact_name': 'Lastname, Firstname',
'contact_position': 'Position Title',
'contact_address': 'Mailing Address',
'contact_city': 'City',
'contact_stateorprovince': 'Administrative Area',
'contact_postalcode': 'Zip or Postal Code',
'contact_country': 'Country',
'contact_phone': '+xx-xxx-xxx-xxxx',
'contact_fax': '+xx-xxx-xxx-xxxx',
'contact_email': 'Email Address',
'contact_url': 'Contact URL',
'contact_hours': 'Hours of Service',
'contact_instructions': 'During hours of service. Off on weekends.',
'contact_role': 'pointOfContact',
},
'metadata:inspire': {
'enabled': 'true',
'languages_supported': 'eng,gre',
'default_language': 'eng',
'date': 'YYYY-MM-DD',
'gemet_keywords': 'Utility and governmental services',
'conformity_service': 'notEvaluated',
'contact_name': 'Organization Name',
'contact_email': 'Email Address',
'temp_extent': 'YYYY-MM-DD/YYYY-MM-DD',
}
}
}
GOOGLE_API_KEY = ""
LOGIN_REDIRECT_URL = "/"
DEFAULT_LAYERS_OWNER='admin'
# Where should newly created maps be focused?
DEFAULT_MAP_CENTER = (120.509033,-2.350415)
# How tightly zoomed should newly created maps be?
# 0 = entire world;
# maximum zoom is between 12 and 15 (for Google Maps, coverage varies by area)
DEFAULT_MAP_ZOOM = 6
DEFAULT_LAYER_SOURCE = {
"ptype":"gxp_wmscsource",
"url":"/geoserver/wms",
"restUrl": "/gs/rest"
}
MAP_BASELAYERS = [{
"source": {"ptype": "gx_olsource"},
"type":"OpenLayers.Layer",
"args":["No background"],
"visibility": False,
"fixed": True,
"group":"background"
},{
"source": { "ptype":"gx_olsource"},
"type":"OpenLayers.Layer.OSM",
"args":["OpenStreetMap"],
"visibility": True,
"fixed": True,
"group":"background"
},{
"source": {"ptype":"gx_olsource"},
"type":"OpenLayers.Layer.WMS",
"group":"background",
"visibility": False,
"fixed": True,
"args":[
"bluemarble",
"http://maps.opengeo.org/geowebcache/service/wms",
{
"layers":["bluemarble"],
"format":"image/png",
"tiled": True,
"tilesOrigin":[-20037508.34,-20037508.34]
},
{"buffer":0}
]
}]
"""
MAP_BASELAYERSOURCES = {
"any": {
"ptype":"gx_olsource"
},
"google":{
"ptype":"gx_googlesource",
"apiKey": GOOGLE_API_KEY
}
}
MAP_BASELAYERS = [{
"source":"any",
"type":"OpenLayers.Layer",
"args":["No background"],
"visibility": False,
"fixed": True,
"group":"background"
},{
"source":"any",
"type":"OpenLayers.Layer.OSM",
"args":["OpenStreetMap"],
"visibility": False,
"fixed": True,
"group":"background"
},{
"source":"any",
"type":"OpenLayers.Layer.WMS",
"group":"background",
"visibility": False,
"fixed": True,
"args":[
"bluemarble",
"http://maps.opengeo.org/geowebcache/service/wms",
{
"layers":["bluemarble"],
"format":"image/png",
"tiled": True,
"tilesOrigin":[-20037508.34,-20037508.34]
},
{"buffer":0}
]
},{
"source":"google",
"group":"background",
"name":"ROADMAP",
"visibility": False,
"fixed": True,
},{
"source":"google",
"group":"background",
"name":"TERRAIN",
"visibility": False,
"fixed": True,
},{
"source":"google",
"group":"background",
"name":"SATELLITE",
"visibility": False,
"fixed": True,
},{
"source":"google",
"group":"background",
"name":"HYBRID",
"visibility": True,
"fixed": True,
}]
"""
INSTALLED_APPS = (
# Apps bundled with Django
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'django.contrib.gis',
# Third party apps
'django_forms_bootstrap',
'notification',
'django_extensions',
'registration',
'pagination',
'profiles',
'avatar',
'dialogos',
'timezones',
'agon_ratings',
'taggit',
'south',
# GeoNode internal apps
'geonode.maps',
'geonode.layers',
'geonode.people',
'geonode.proxy',
'geonode.security',
'geonode.catalogue',
# Tsudat Apps
'tsudat2.tsudat',
# Message transport
'djcelery',
'djkombu', #Only used if BROKER_TRANSPORT='django'
)
TSUDAT_BASE_DIR='/data/run_tsudat/'
#TSUDAT_MUX_DIR='/data/Tsu-DAT_Data/earthquake_data' # *instance* path to mux data
TSUDAT_MUX_DIR='/var/tsudat/muxfiles'
TSUDAT_DEF_DIR='/var/tsudat/deffiles'
# Celery Settings http://ask.github.com/celery/configuration.html
CELERY_IMPORTS = ("tsudat.tasks", )
CELERY_SEND_TASK_ERROR_EMAILS = True
CELERY_SEND_EVENTS = True
CELERYD_LOG_LEVEL = "DEBUG"
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_RESULT_BACKEND = "database"
CELERY_RESULT_DBURI = "postgresql://tsudat:tsudat@localhost/tsudat"
BROKER_TRANSPORT = "amqplib"
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_VHOST = "/"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
# If Django is used as the Broker Transport
# djkombu is required in INSTALLED_APPS
#BROKER_TRANSPORT = "django"
import djcelery
djcelery.setup_loader()
def get_user_url(u):
from django.contrib.sites.models import Site
s = Site.objects.get_current()
return "http://" + s.domain + "/profiles/" + u.username
ABSOLUTE_URL_OVERRIDES = {
'auth.user': get_user_url
}
SERIALIZATION_MODULES = {
'json': 'wadofstuff.django.serializers.json'
}
# For django-profiles
AUTH_PROFILE_MODULE = 'people.Contact'
REGISTRATION_OPEN = False
SERVE_MEDIA = DEBUG;
#Import uploaded shapefiles into a database such as PostGIS?
DB_DATASTORE=False
#Database datastore connection settings
DB_DATASTORE_NAME = ''
DB_DATASTORE_USER = ''
DB_DATASTORE_PASSWORD = ''
DB_DATASTORE_HOST = ''
DB_DATASTORE_PORT = ''
DB_DATASTORE_TYPE=''
try:
from local_settings import *
except ImportError:
pass