[GeoNode-devel] Getting my django app to save to postgis instead of the default database...

Simone Dalmasso simone.dalmasso at gmail.com
Mon May 9 12:48:43 PDT 2016


Is all good except that once you have your data in geoserver the command is
not "importlayers" but "updatelayers" in order to get them in geonode.

Regards

2016-05-09 20:29 GMT+02:00 Dave Kennewell <davekennewell at gmail.com>:

> Thanks Simone,
>
> That gives me the confidence to use DATABASE_ROUTERS to store the data in
> "geonode_data".
>
> From here I can hopefully then import/configure it in geoserver, roughly
> following
> http://docs.geonode.org/en/master/tutorials/admin/loading_data_into_geonode/geoserver.html
>
> and finally create the layer in geonode using importlayers.
>
> I think that should work, but I welcome any advice from anyone if I'm
> naively missing any roadblocks.
>
>
>
> On 9 May 2016 at 21:19, Simone Dalmasso <simone.dalmasso at gmail.com> wrote:
>
>> Hi it is correct, geonode models don't describe the layer contents only
>> the Layer entity. the geonode Layer table is in the geonode database and
>> contain the layers description while the shapefile content is stored in
>> dedicated tables in geonode_data and is created by geoserver on layer
>> upload.
>>
>> 2016-05-09 19:01 GMT+02:00 Dave Kennewell <davekennewell at gmail.com>:
>>
>>> Hi all,
>>>
>>> I have a django app that harvests latitude and longitude as float
>>> numbers, together with some text, and stores them in a model. After syncdb,
>>> this happily writes to my "geonode" default database.
>>>
>>> But I want to plot this data in geoserver, and show it as a layer in
>>> geonode. So (I assume) I need to get the harvested data into the
>>> "geonode_data" postgis database.
>>>
>>> When I look into the django documentation for multiple databases
>>> <https://docs.djangoproject.com/en/1.7/topics/db/multi-db/#defining-your-databases>,
>>> it suggests I use DATABASE_ROUTERS to achieve this. Sounds reasonable.
>>>
>>> But when I search the geonode codebase for DATABASE_ROUTERS there is nothing
>>> going on
>>> <https://github.com/GeoNode/geonode/search?utf8=%E2%9C%93&q=DATABASE_ROUTERS>
>>> .
>>>
>>> Is it correct that the only way data gets into a standard geonode
>>> datastore is directly via the upload app, and not via any models?
>>>
>>> Before I go down the DATABASE_ROUTERS rabbithole, I wanted to check if
>>> this is the correct way to get model data into the datastore, or am I
>>> missing something?
>>>
>>> Thanks for any help
>>> Dave
>>>
>>>
>>> _______________________________________________
>>> geonode-devel mailing list
>>> geonode-devel at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/geonode-devel
>>>
>>>
>>
>>
>> --
>> Simone
>>
>
>


-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20160509/71eacad0/attachment.html>


More information about the geonode-devel mailing list