[GeoNode-users] Template extension over multiple apps

Stefano.LUONI at ext.ec.europa.eu Stefano.LUONI at ext.ec.europa.eu
Tue Nov 14 04:48:10 PST 2017


Hi everyone,

I know that it sounds more of a Django related question, but as a non Django expert I'm a bit confused about the ways to extend templates.

The problem
In a development environment, suppose we have created a new app and suppose we call it app1; we can customise the page look by editing site_base.html for global parts, index.html or other specific templates, knowing that site_base will extend base.html from geonode/templates folder, and so on.
What if we create another custom app and we call it app2: how can we define templates that could inherit from what was already defined by app1?

The directory tree looks like this:

-virtual_environment
-geonode
    -geonode
        -templates
            -base.html
            -index.html
-custom_project
    -app1
        -templates
            -site_base.html (extends base.html)
            -site_index.html (extends index.html)
    -app2
        -templates
            -new_template => how to extend site_base.html?

The issue I'm facing is that as soon as I enable context_processors in my settings.py, I get an error because the Geonode base.html template is not found (from extends base.html in geonode/base/templates/geonode_base.html).
I tried using different configurations with loaders like app_namespace or apptemplates with no luck.

Do you have any suggestions for solving this?

Thanks,

Stefano




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20171114/2f8ef652/attachment.html>


More information about the geonode-users mailing list