<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Dear Eugenio,
<div dir="auto"><br /></div>
<div dir="auto">I believe this is the correct settings. Django will use database named `geonode`, while `geonode_data` is used as postgis datastore by GeoServer.</div>
<div dir="auto"><br /></div>
<div dir="auto">You already confirm in the previous email that you are able to see the layer from GeoServer’s Layer Preview, so most probably the postgis datastore connections to geonode_data (in GeoServer) is correct.</div>
<div dir="auto"><br /></div>
<div dir="auto">So the next thing we need to check is the oauth2 settings both in GeoServer and Geonode should use the same Oauth token. You could try giving us both screenshots to check.</div>
<div dir="auto"><br /></div>
<div dir="auto">In addition to that, I would suggest to screen capture the browser error logs when navigating into the map client to view the layer. Perhaps the javascript logs can tell us something.</div>
</div>
</div>
<div name="messageSignatureSection"><br />
<div>Regards,
<div>
<div>--</div>
<div>Rizky Maulana Nugraha</div>
<div>Kartoza</div>
<a href="mailto:rizky@kartoza.com">rizky@kartoza.com</a></div>
</div>
</div>
<div name="messageReplySection">On 2 Apr 2020 21.15 +0700, Eugenio Trumpy <frippe12573@hotmail.com>, wrote:<br />
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Dear Toni,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br /></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">thanks for these further hints.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">I comment and put the testing results among your lines:</div>
<div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">
<div>
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;"></blockquote>
<div><br class="" /></div>
<div>Check which connection is used by Django shell:</div>
<div><br class="" /></div>
<div># enable your venv</div>
<div># set your correct settings with DJANGO_SETTINGS_MODULE</div>
<div><br class="" /></div>
<div>DJANGO_SETTINGS_MODULE=my_geonode.local_settings python manage.py shell </div>
from django import db</div>
<div>db.utils.settings.DATABASES['default']['NAME']</div>
<div><br class="" /></div>
<div>...  '/Users/ts/git/gitlabtest/env/src/geonode/geonode/development.db'</div>
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>^ this shows I'm using sqlite. Namely development.db. I would expect something with postgres here in your case.</div>
<div><br class="" /></div>
<div><span style="color: rgb(23, 78, 134);">If I did correctly I got, I gave: <span style="color: rgb(23, 78, 134); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important;">db.utils.settings.DATABASES['default']</span></span></div>
<div><span style="color: rgb(23, 78, 134);"><span style="color: rgb(23, 78, 134); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important;"><br /></span></span></div>
<div><span style="color: rgb(23, 78, 134);"><span style="color: rgb(23, 78, 134); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important;">I got 
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures">{'NAME': 'geonode',</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'USER': 'geonode',</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'PASSWORD': 'geonode',</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'HOST': 'localhost',</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'PORT': 5432,</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'CONN_MAX_AGE': 5,</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'ENGINE': 'django.db.backends.postgresql_psycopg2',</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'OPTIONS': {'connect_timeout': 5},</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'ATOMIC_REQUESTS': False,</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'AUTOCOMMIT': True,</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'TIME_ZONE': None,</span></p>
<p style="margin: 0px; font: 10px Monaco; color: rgb(242, 242, 242); background-color: rgba(0, 0, 0, 0.85); margin: 0px; background-color: rgba(0, 0, 0, 0.85)"><span style="font-variant-ligatures: no-common-ligatures; font-variant-ligatures: no-common-ligatures"><span></span>'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}</span></p>
</span></span></div>
<div><br /></div>
<div><span style="color: rgb(23, 78, 134);">which is the geonode db, and not the one with the data.</span></div>
<div><span style="color: rgb(23, 78, 134);"></span></div>
<div><span style="color: rgb(23, 78, 134);"><br /></span></div>
<div><span style="color: rgb(23, 78, 134);">I presume this is not correct, I would expect the connection string to the geonode_data database.</span></div>
<div><span style="color: rgb(23, 78, 134);"><br /></span></div>
<div><span style="color: rgb(23, 78, 134);">I pastebin some my settings.py lines related to the DATABASES: <a href="https://pastebin.com/nyiV23gm" id="LPlnk618813">https://pastebin.com/nyiV23gm</a></span></div>
<div>
<div><br class="" /></div>
<div>If above gives you something with postgres still in terminal let's check which layers your database</div>
<div>holds.</div>
<div><br class="" /></div>
<div><span style="color: rgb(23, 78, 134);">yes, if the simple geonode (and not geonode_data) is correct</span></div>
<div><br /></div>
<div>from geonode.layers.models import Layer</div>
<div>l = Layer.objects.all()</div>
for i in l: print (i.title)</div>
<div><br /></div>
<div>This should give you a listing of all your layer titles. </div>
<div>If not either your layers are not in geonode database found</div>
<div>or your local_setting is using a wrong database connection (which ends f.e in sqlite)</div>
<div><br /></div>
<div><span style="color: rgb(23, 78, 134); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">This returns me a lot of layers, all I have actually</span></div>
<div><br class="" /></div>
<div>I can offer to have a look at your settings but would need:</div>
<div>- screenshot of your <u class="">oauth2 and rest</u> setting on side of geoserver</div>
<div>- screenshot of your oauth2 settings on side of geonode</div>
<div>- the part from your local_settings for Geoserver endpoints.</div>
<div><br class="" /></div>
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>* of course as p.m.</div>
<div><br class="" /></div>
<div>Somewhere here I would expect something wrong.</div>
<div><br class="" /></div>
<div>Well, apart last point, I think the problem is still the connection to the geonode_data db.</div>
<div><br /></div>
<div>Thanks for now,</div>
<div>other suggestions?</div>
<div><br /></div>
<div>Eugenio</div>
<div><br class="" /></div>
<div><br class="" /></div>
<div><br class="" /></div>
<div><br class="" /></div>
<br class="" /></div>
</div>
</div>
_______________________________________________<br />
geonode-users mailing list<br />
geonode-users@lists.osgeo.org<br />
https://lists.osgeo.org/mailman/listinfo/geonode-users<br /></blockquote>
</div>
</body>
</html>