Saturday 20 October 2018

Customize GeoNode after a quick install


I've install GeoNode through apt-get install geonode. As per the Quick Installation Guide.
After such installation how do one customize the pages ? I don't seem to find any indication reading the doc on how it should be done.


I followed the instructions at Setup & Configure HTTPD and I'm having some issues customizing.
The changes made in site_index.html don't show up when I visit the home page.


Am i obligated to create a project as per GeoNode (v2.6) installation on Ubuntu ?


Any advice would be nice.




Answer



I did the same installation and it works fine in geonode2.6.3. It´s important that you edit the file in the correct path: /home/geonode/geonode/geonode/templates/site_index.html (or whatever name you put to your project instead of "geonode"). Also check your wsgi.py file, that it´s pointing to your geonode project:


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_geonode_project_name.settings")

NOTE: by only changing back to "geonode.settings" in this file you can change the whole theme from your-project-theme to the default one.


It is not necessary to restart apache to see this changes, but depending on your browser you might have to empty cache. If you edited the css files, run the collectstatic command to see changes. All template files you want to edit, should be copied first to the above path in the same location they are in /etc/geonode/templates. For example: if you want to edit the layer_details.html file, wich is in /etc/geonode/templates/layers/, copy the file to /home/geonode/geonode/geonode/templates/layers/layer_detail.html and edit this one (it´ll override the first one). You can edit straight in the /etc/geonode but you will have a better organized geonode project if you work on your geonode project folder, and you also keep a backup 0km file if you ever need it. Hope this helped.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...