Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. #DATABASE_URL = os.getenv(
  2. # 'DATABASE_URL',
  3. # 'sqlite:///{path}'.format(
  4. # path=os.path.join(PROJECT_ROOT, 'development.db')
  5. # )
  6. #)
  7.  
  8. # DATABASE_URL = 'postgresql://test_geonode:test_geonode@localhost:5432/geonode'
  9. DATABASE_URL = 'postgresql://geonode:geonode@localhost:5432/geonode'
  10.  
  11. # Defines settings for development
  12.  
  13. # since GeoDjango is in use, you should use gis-enabled engine, for example:
  14. # 'ENGINE': 'django.contrib.gis.db.backends.postgis'
  15. # see https://docs.djangoproject.com/en/1.8/ref/contrib/gis/db-api/#module-django.contrib.gis.db.backends for
  16. # detailed list of supported backends and notes.
  17. _db_conf = dj_database_url.parse(DATABASE_URL, conn_max_age=5)
  18. if 'spatialite' in DATABASE_URL:
  19. SPATIALITE_LIBRARY_PATH = 'mod_spatialite.so'
  20.  
  21. if 'CONN_TOUT' in _db_conf:
  22. _db_conf['CONN_TOUT'] = 5
  23. if 'postgresql' in DATABASE_URL or 'postgis' in DATABASE_URL:
  24. if 'OPTIONS' not in _db_conf:
  25. _db_conf['OPTIONS'] = {}
  26. _db_conf['OPTIONS'].update({
  27. 'connect_timeout': 5,
  28. })
  29.  
  30. DATABASES = {
  31. 'default': _db_conf
  32. #'postgis://geonode:geonode@localhost:5432/geonode_data': _db_conf
  33. }
  34.  
  35. if os.getenv('DEFAULT_BACKEND_DATASTORE'):
  36. GEODATABASE_URL = os.getenv('GEODATABASE_URL',
  37. 'postgis://geonode:geonode@localhost:5432/geonode_data')
  38. DATABASES[os.getenv('DEFAULT_BACKEND_DATASTORE')] = dj_database_url.parse(
  39. GEODATABASE_URL, conn_max_age=5
  40. )
  41. _geo_db = DATABASES[os.getenv('DEFAULT_BACKEND_DATASTORE')]
  42. if 'CONN_TOUT' in DATABASES['default']:
  43. _geo_db['CONN_TOUT'] = 5
  44. if 'postgresql' in GEODATABASE_URL or 'postgis' in GEODATABASE_URL:
  45. _geo_db['OPTIONS'] = DATABASES['default']['OPTIONS'] if 'OPTIONS' in DATABASES['default'] else {}
  46. _geo_db['OPTIONS'].update({
  47. 'connect_timeout': 5,
  48. })
  49.  
  50.  
  51. DATABASES[os.getenv('DEFAULT_BACKEND_DATASTORE')] = _geo_db
  52.  
  53. ....
  54.  
  55. OGC_SERVER = {
  56. 'default': {
  57. 'BACKEND': 'geonode.geoserver',
  58. 'LOCATION': 'http://geothoponode2.igg.cnr.it:8080/geoserver2', #GEOSERVER_LOCATION,
  59. 'WEB_UI_LOCATION': 'http://geothoponode2.igg.cnr.it:8080/geoserver2', #GEOSERVER_WEB_UI_LOCATION,
  60. 'LOGIN_ENDPOINT': 'j_spring_oauth2_geonode_login',
  61. 'LOGOUT_ENDPOINT': 'j_spring_oauth2_geonode_logout',
  62. # PUBLIC_LOCATION needs to be kept like this because in dev mode
  63. # the proxy won't work and the integration tests will fail
  64. # the entire block has to be overridden in the local_settings
  65. 'PUBLIC_LOCATION': 'http://geothoponode2.igg.cnr.it:8080/geoserver2', #GEOSERVER_PUBLIC_LOCATION,
  66. 'USER': 'admin', #OGC_SERVER_DEFAULT_USER,
  67. 'PASSWORD': 'geoserver', #OGC_SERVER_DEFAULT_PASSWORD,
  68. 'MAPFISH_PRINT_ENABLED': ast.literal_eval(os.getenv('MAPFISH_PRINT_ENABLED', 'True')),
  69. 'PRINT_NG_ENABLED': ast.literal_eval(os.getenv('PRINT_NG_ENABLED', 'True')),
  70. 'GEONODE_SECURITY_ENABLED': ast.literal_eval(os.getenv('GEONODE_SECURITY_ENABLED', 'True')),
  71. 'GEOFENCE_SECURITY_ENABLED': GEOFENCE_SECURITY_ENABLED,
  72. 'GEOFENCE_URL': os.getenv('GEOFENCE_URL', 'internal:/'),
  73. 'WMST_ENABLED': ast.literal_eval(os.getenv('WMST_ENABLED', 'False')),
  74. 'BACKEND_WRITE_ENABLED': ast.literal_eval(os.getenv('BACKEND_WRITE_ENABLED', 'True')),
  75. 'WPS_ENABLED': ast.literal_eval(os.getenv('WPS_ENABLED', 'True')),
  76. 'LOG_FILE': '%s/geoserver2/data/logs/geoserver.log'
  77. % os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir)),
  78. # Set to name of database in DATABASES dictionary to enable
  79. # 'datastore',
  80. 'DATASTORE': 'postgis://geonode:geonode@localhost:5432/geonode_data', 'repoigg' #os.getenv('DEFAULT_BACKEND_DATASTORE', ''),
  81. 'TIMEOUT': int(os.getenv('OGC_REQUEST_TIMEOUT', '10')),
  82. 'MAX_RETRIES': int(os.getenv('OGC_REQUEST_MAX_RETRIES', '3')),
  83. 'BACKOFF_FACTOR': float(os.getenv('OGC_REQUEST_BACKOFF_FACTOR', '0.3')),
  84. 'POOL_MAXSIZE': int(os.getenv('OGC_REQUEST_POOL_MAXSIZE', '10')),
  85. 'POOL_CONNECTIONS': int(os.getenv('OGC_REQUEST_POOL_CONNECTIONS', '10')),
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement