[GeoNode-devel] Practices on maintaining a geonode project, PR: "Align to GeoNode master 4.2.0"

Henning Bredel h.bredel at 52north.org
Tue Aug 1 02:06:14 PDT 2023


Hey Toni,

thanks for sharing the approaches you already tried and giving your 
opinions on each!

> Another approach I've used is creating patch files using diff, which works but can be time-consuming in certain situations.
> 
> For the sake of completeness:
> 
> You could also fork the project, and locally replace needed parts with smudge and clean filters when deploying:
> [filter "updateProjectName"]
> 	smudge = sed \"s/{{[[:blank:]]*project_name[[:blank:]]*}}/my_geonode/g\"
> 	clean = sed  \“s/my_geonode/{{project_name}}/g\“
> 
> Doing so you can keep the git history of the upstream project!
> This is what I used for years. But which in the end felt not intuitiv …
> (Read more about it here: https://bignerdranch.com/blog/git-smudge-and-clean-filters-making-changes-so-you-dont-have-to/)


Interesting approach. It seems even the blog you mention agrees with you 
when  saying "[...] so we had to help all developers apply the filter. 
That is one downside: it’s totally quiet, so failures aren’t readily 
surfaced." :-)


> Finally I switched from geonode-project to using the core for all clients. Here I prefer avoiding forking whenever possible, opting instead to extend geonode with a custom app where I can include my code, override things and patch settings using apps.py, among other things.


We did similar things in the externalapplications [0] app, just for the 
purpose of self-containedness. This truely works quite well, but I have 
to admit, that we were not able to separate it completely, because of 
changes we had to make in the geonode-mapstore-client. I will consider 
this approach more from the integration perspective next time.

However, I still assume changes in your working copy

- INSTALLED_APPS or requirements.txt
- docker/-compose files

These changes can be kept at a minimum and probably in a local branch, 
of course. Did you also try different approaches with regard to 
customizing geonode-mapstore-client, or do you prefer programming a 
completely different UI (probably this depends ;-))?


> I have an example of how to inject your own URLs and middleware without modifying urls.py or the middleware from geonode core. You can find it in this gist on GitHub: https://gist.github.com/t-book/b0ef421d16bcd67f494b3e2943c44ad4
> By the way, this is how geonode-mapstore-client integrates itself.
> 
> Hope this helps a bit.


Definitely, thank you again.


Best

   Henning


[0] 
https://github.com/GeoNodeUserGroup-DE/contrib_externalapplications/blob/main/externalapplications/__init__.py

-- 
Henning Bredel
52°North Spatial Information Research GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: h.bredel at 52north.org
http://52north.org/
Twitter: @FiveTwoN
Managing Directors:
Dr. Benedikt Gräler, Dr. Simon Jirka, Matthes Rieke
Local Court Muenster HRB 10849
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20230801/e2fdb023/attachment.sig>


More information about the geonode-devel mailing list