[GeoNode-users] settings_local.py not reflecting

Zizi Jama mazizi.jama at gmail.com
Tue Oct 2 00:55:26 PDT 2018


Hello,

I have a geonode deployment based on
https://github.com/geosolutions-it/geonode-generic
This is running on my local machine.

I want to add additional basemaps - according to geonode documentation it
is recommended that one edits settings_local.py

Is this the correct approach in this instance?

Since I am using containers is it recommended to use docker volume in order
to persist changes without having to create own image? (This is because on
restart the changes to settings_local.py)

My settings.local.py looks like this (is it configured properly? These are
not reflecting in my setup even after restarting the services. Any ideas
what could be wrong?

# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################

#import ast
#import os
#from urlparse import urlparse, urlunparse
from geonode.settings import *

# default map projection
# Note: If set to EPSG:4326, then only EPSG:4326 basemaps will work.
DEFAULT_MAP_CRS = "EPSG:3857"

DEFAULT_LAYER_FORMAT = "image/png"

# Where should newly created maps be focused?
DEFAULT_MAP_CENTER = (0,0)

# 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 = 11

ALT_OSM_BASEMAPS = os.environ.get('ALT_OSM_BASEMAPS', False)
CARTODB_BASEMAPS = os.environ.get('CARTODB_BASEMAPS', False)
STAMEN_BASEMAPS = os.environ.get('STAMEN_BASEMAPS', False)
THUNDERFOREST_BASEMAPS = os.environ.get('THUNDERFOREST_BASEMAPS', False)
MAPBOX_ACCESS_TOKEN = os.environ.get('MAPBOX_ACCESS_TOKEN', '')
BING_API_KEY = os.environ.get('xjxjjxjxjxjjxjxjxjjxjxjxjxjxjxjxjxj_', None)
GOOGLE_API_KEY = os.environ.get('sisosopspsppspspsppsss', None)

MAP_BASELAYERS = [{
    "source": {"ptype": "gxp_olsource"},
    "type": "OpenLayers.Layer",
    "args": ["No background"],
    "name": "background",
    "visibility": False,
    "fixed": True,
    "group":"background"
#}, {
#    "source": {"ptype": "gxp_olsource"},
#    "type": "OpenLayers.Layer.XYZ",
#    "title": "UNESCO",
#    "args": ["UNESCO", "http://en.unesco.org/tiles/${z}/${x}/${y}.png"],
#    "wrapDateLine": True,
#    "name": "background",
#    "attribution": "© UNESCO",
#    "visibility": False,
#    "fixed": True,
#    "group":"background"
#}, {
#    "source": {"ptype": "gxp_olsource"},
#    "type": "OpenLayers.Layer.XYZ",
#    "title": "UNESCO GEODATA",
#    "args": ["UNESCO GEODATA", "
http://en.unesco.org/tiles/geodata/${z}/${x}/${y}.png"],
#    "name": "background",
#    "attribution": "© UNESCO",
#    "visibility": False,
#    "wrapDateLine": True,
#    "fixed": True,
#    "group":"background"
#}, {
#    "source": {"ptype": "gxp_olsource"},
#    "type": "OpenLayers.Layer.XYZ",
#    "title": "Humanitarian OpenStreetMap",
#    "args": ["Humanitarian OpenStreetMap", "
http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png"],
#    "name": "background",
#    "attribution": "© <a
href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>,
Tiles courtesy of <a href='http://hot.openstreetmap.org/'
target='_blank'>Humanitarian OpenStreetMap Team</a>",
#    "visibility": False,
#    "wrapDateLine": True,
#    "fixed": True,
#    "group":"background"
# }, {
#     "source": {"ptype": "gxp_olsource"},
#     "type": "OpenLayers.Layer.XYZ",
#     "title": "MapBox Satellite Streets",
#     "args": ["MapBox Satellite Streets", "
http://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/${z}/${x}/${y}?access_token=
"+MAPBOX_ACCESS_TOKEN],
#     "name": "background",
#     "attribution": "© <a
href='https://www.mapbox.com/about/maps/'>Mapbox</a>
© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>
<a href='https://www.mapbox.com/feedback/' target='_blank'>Improve this
map</a>",
#     "visibility": False,
#     "wrapDateLine": True,
#     "fixed": True,
#     "group":"background"
# }, {
#     "source": {"ptype": "gxp_olsource"},
#     "type": "OpenLayers.Layer.XYZ",
#     "title": "MapBox Streets",
#     "args": ["MapBox Streets", "
http://api.mapbox.com/styles/v1/mapbox/streets-v9/tiles/${z}/${x}/${y}?access_token=
"+MAPBOX_ACCESS_TOKEN],
#     "name": "background",
#     "attribution": "© <a
href='https://www.mapbox.com/about/maps/'>Mapbox</a>
© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>
<a href='https://www.mapbox.com/feedback/' target='_blank'>Improve this
map</a>",
#     "visibility": False,
#     "wrapDateLine": True,
#     "fixed": True,
#     "group":"background"
}, {
    "source": {"ptype": "gxp_osmsource"},
    "type": "OpenLayers.Layer.OSM",
    "title": "OpenStreetMap",
    "name": "mapnik",
    "attribution": "© <a href='http://osm.org/copyright'>OpenStreetMap</a>
contributors",
    "visibility": True,
    "wrapDateLine": True,
    "fixed": True,
    "group": "background"
}, {
    "source": {"ptype": "gxp_olsource"},
    "type": "OpenLayers.Layer.XYZ",
    "title": "CD:NGI AERIAL",
    "args": ["CD:NGI AERIAL", "
http://a.aerial.openstreetmap.org.za/ngi-aerial/${z}/${x}/${y}.jpg"],
    "wrapDateLine": True,
    "name": "CD:NGI AERIAL",
    "attribution": "© CD:NGI AERIAL",
    "visibility": False,
    "fixed": True,
    "group":"background"
#}, {
#   "source": {
#             "ptype":"gxp_bingsource",
#             "apiKey":"xjxjjxjxjxjjxjxjxjjxjxjxjxjxjxjxjxj_"
#             },
#   "group":"background",
#   "name":"Aerial",
#   "title":"Bing Satellite Imagery",
#   "visibility": False,
#   "fixed":True
#}, {
#    "source": {"ptype":"gxp_googlesource", otherParams":
"sensor=false&key={0}".format(GOOGLE_API_KEY)},
#    "title": "GOOGLE SATELLITE"
#    "name": "SATELLITE",
#    "visibility": False,
#    "fixed": True,
#    "group":"background"
}]

if 'geonode.geoserver' in INSTALLED_APPS:
    LOCAL_GEOSERVER = {
        "source": {
            "ptype": "gxp_wmscsource",
            "url": OGC_SERVER['default']['PUBLIC_LOCATION'] + "wms",
            "restUrl": "/gs/rest"
        }
    }
    baselayers = MAP_BASELAYERS
    MAP_BASELAYERS = [LOCAL_GEOSERVER]
    MAP_BASELAYERS.extend(baselayers)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20181002/b5eeb163/attachment.html>


More information about the geonode-users mailing list