<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Steffen,<div class=""><br class=""></div><div class="">sorry. Did not test it before sending. But darkly remember I did something like this with 2.4.</div><div class="">Anyways from a quick look the problem is that your map has wrong</div><div class="">zoom</div><div class="">center-x</div><div class="">center-y</div><div class=""><br class=""></div><div class="">further your added layer is missing:</div><div class="">OWS URL</div><div class="">Layer params</div><div class="">Source params</div><div class=""><br class=""></div><div class="">You can test it by manually creating a map with same layer and afterwards by django shell.</div><div class="">As soon as you fix those values in django admin it works.</div><div class=""><br class=""></div><div class="">Unfortuanately I'm facing a strict deadline and cannot say when there will be time for further tests. </div><div class="">But would suggest that you start by having a look at the maps model.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Toni</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 11.09.2019 um 17:06 schrieb EFTAS Carsten Stemmler <<a href="mailto:carsten.stemmler@eftas.com" class="">carsten.stemmler@eftas.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Hello Toni,<br class=""><br class="">thank you for your help, this was already quite useful.<br class="">Maybe you can also help with a follow-up question:<br class=""><br class="">I created a new map using the way you pointed out and the map is visible in the Geonode maps overview.<br class="">But when I try to view the map, the layers are unfortunately not visible to the user (who created the map). All layers are also owned by the same user.<br class="">To check for general errors on the system, I created a map manually with the same layers using the Mapstore GUI and this map is displayed without a problem.<br class="">I was unfortunately also not able to spot any error messages on the server or client, which hint to a problem with the map.<br class=""><br class="">Any hints are appreciated,<br class="">Carsten<br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">Carsten Stemmler<br class="">- Research & Development<br class=""><br class="">E F T A S    Fernerkundung<br class="">Technologietransfer GmbH<br class="">Oststraße 2-18<br class="">48145 Münster<br class="">Fon: +49 251 13307-0      E-Mail:<span class="Apple-converted-space"> </span><a href="mailto:carsten.stemmler@eftas.com" class="">carsten.stemmler@eftas.com</a><br class="">Fax: +49 251 13307-33     Web:  <span class="Apple-converted-space"> </span><a href="http://www.eftas.com/" class="">http://www.eftas.com</a><br class="">Geschäftsführer:<br class="">Dipl.-Ing. Georg Altrogge<br class=""><br class="">Sitz der Gesellschaft: Münster<br class="">Amtsgericht Münster, HRB 2999<br class="">USt.-IdNr. DE 126038986<div style="font-family: "Times New Roman"; font-size: 16px;" class=""><hr tabindex="-1" class=""><div id="divRpF390374" style="direction: ltr;" class=""><font size="2" face="Tahoma" class=""><b class="">Von:</b><span class="Apple-converted-space"> </span>Toni Schönbuchner [<a href="mailto:toni.schoenbuchner@csgis.de" class="">toni.schoenbuchner@csgis.de</a>]<br class=""><b class="">Gesendet:</b><span class="Apple-converted-space"> </span>Montag, 9. September 2019 20:14<br class=""><b class="">An:</b><span class="Apple-converted-space"> </span>EFTAS Carsten Stemmler<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:geonode-devel-owner@lists.osgeo.org" class="">geonode-devel-owner@lists.osgeo.org</a><br class=""><b class="">Betreff:</b><span class="Apple-converted-space"> </span>Re: Programmatically create layers and maps from own Django App<br class=""></font><br class=""></div><div class=""></div><div class="">Hi Carsten,<div class=""><br class=""></div><div class="">in case you have generated files on your disk maybe it could be enough to just use importlayers?</div><div class="">Have a look how it's done here: <a href="https://github.com/GeoNode/geonode/blob/master/pavement.py#L1002" class="" target="_blank" rel="noopener noreferrer">https://github.com/GeoNode/geonode/blob/master/pavement.py#L1002</a></div><div class=""><br class=""></div><div class="">For map creation I would go with something like:</div><div class=""><br class=""></div><div class="">$ python manage.py shell</div><div class=""><br class=""></div><div class=""><div class="">from geonode.layers.models import Layer</div><div class="">from geonode.maps.models import Map</div><div class="">from geonode.people.models import Profile</div><div class=""><br class=""></div><div class="">user = Profile.objects.get(id=1000)</div><div class="">m = Map()</div><div class="">layer_name = Layer.objects.all().first().alternate</div><div class="">m.create_from_layer_list(user, [layer_name], "title", "abstract")</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">In this case 1000 is the ID of my admin user. You would pass your newly imported layers to </div><div class="">m.create_from_layer_list()</div><div class=""><br class=""></div><div class="">cheers,</div><div class=""><br class=""></div><div class="">Toni</div><div class=""><br class=""></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">Am 09.09.2019 um 12:13 schrieb<span class="Apple-converted-space"> </span><a href="mailto:geonode-devel-owner@lists.osgeo.org" class="" target="_blank" rel="noopener noreferrer">geonode-devel-owner@lists.osgeo.org</a>:</div><br class="Apple-interchange-newline"><div class=""><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">As list administrator, your authorization is requested for the</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">following mailing list posting:</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">   List:    </span><a href="mailto:geonode-devel@lists.osgeo.org" class="" target="_blank" rel="noopener noreferrer" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">geonode-devel@lists.osgeo.org</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">   From:    </span><a href="mailto:carsten.stemmler@eftas.com" class="" target="_blank" rel="noopener noreferrer" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">carsten.stemmler@eftas.com</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">   Subject: Programmatically create layers and maps from own Django App</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">   Reason:  Post to moderated list</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">At your convenience, visit:</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">   </span><a href="https://lists.osgeo.org/mailman/admindb/geonode-devel" class="" target="_blank" rel="noopener noreferrer" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">https://lists.osgeo.org/mailman/admindb/geonode-devel</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">to approve or deny the request.</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Von:<span class="Apple-converted-space"> </span></b></span><span class="">EFTAS Carsten Stemmler <<a href="mailto:carsten.stemmler@eftas.com" class="" target="_blank" rel="noopener noreferrer">carsten.stemmler@eftas.com</a>><br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Betreff:<span class="Apple-converted-space"> </span></b></span><span class=""><b class="">Programmatically create layers and maps from own Django App</b><br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Datum:<span class="Apple-converted-space"> </span></b></span><span class="">9. September 2019 um 11:39:39 MESZ<br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">An:<span class="Apple-converted-space"> </span></b></span><span class="">"<a href="mailto:geonode-devel@lists.osgeo.org" class="" target="_blank" rel="noopener noreferrer">geonode-devel@lists.osgeo.org</a>" <<a href="mailto:geonode-devel@lists.osgeo.org" class="" target="_blank" rel="noopener noreferrer">geonode-devel@lists.osgeo.org</a>><br class=""></span></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div class="" style="font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; direction: ltr; font-family: Tahoma; font-size: 10pt;">Dear all,<br class=""><br class="">I created a new Django App by using geonode-project (Geonode version 2.10) to do some geospatial processing.<br class="">As a result of this process I want to create a new layer (and furthermore a map) within Geonode without user interaction.<span class="Apple-converted-space"> </span><br class=""><br class="">I already had a look at the documentation, however I'm not sure about the right way to accomplish this task. Can I use internal functions e.g. from<span class="" style="color: rgb(197, 134, 192);"><span class="Apple-converted-space"> </span></span><font class=""><i class="">geonode.layers.models<span class="Apple-converted-space"> </span></i>or is it necessary to use the Geoserver Rest API to import the data there directly (or another way I am not aware of at the moment)?<br class=""><br class="">Any hints and also specific links to the documentation are appreciated.<br class="">Carsten<br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">Carsten Stemmler<br class="">- Research & Development<br class=""><br class="">E F T A S    Fernerkundung<br class="">Technologietransfer GmbH<br class="">Oststraße 2-18<br class="">48145 Münster<br class="">Fon: +49 251 13307-0      E-Mail:<span class="Apple-converted-space"> </span><a href="mailto:carsten.stemmler@eftas.com" class="" target="_blank" rel="noopener noreferrer">carsten.stemmler@eftas.com</a><br class="">Fax: +49 251 13307-33     Web:  <span class="Apple-converted-space"> </span><a href="http://www.eftas.com/" class="" target="_blank" rel="noopener noreferrer">http://www.eftas.com</a><br class="">Geschäftsführer:<br class="">Dipl.-Ing. Georg Altrogge<br class=""><br class="">Sitz der Gesellschaft: Münster<br class="">Amtsgericht Münster, HRB 2999<br class="">USt.-IdNr. DE 126038986<br class=""><i class=""></i></font></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Von:<span class="Apple-converted-space"> </span></b></span><span class=""><a href="mailto:geonode-devel-request@lists.osgeo.org" class="" target="_blank" rel="noopener noreferrer">geonode-devel-request@lists.osgeo.org</a><br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Betreff:<span class="Apple-converted-space"> </span></b></span><span class=""><b class="">confirm 61cb4ec0107fc608b6f30c51a47cea3e31831aea</b><br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; margin: 0px;"><span class="" style="color: rgb(127, 127, 127);"><b class="">Datum:<span class="Apple-converted-space"> </span></b></span><span class="">9. September 2019 um 12:13:03 MESZ<br class=""></span></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">If you reply to this message, keeping the Subject: header intact,</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">Mailman will discard the held message.  Do this if the message is</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">spam.  If you reply to this message and include an Approved: header</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">with the list password in it, the message will be approved for posting</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">to the list.  The Approved: header can also appear in the first line</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">of the body of the reply.</span></div></blockquote></div></div></div></div></div></div></blockquote></div><br class=""></div></body></html>