Comment 1 for bug 1097671

Revision history for this message
Ben Wyss (bmwyss) wrote :

In order to add the dwelling fractions & exposure export application to the OQP I applied the following setting by hand to an existing OQP installation:

HTML and JS:

add exposure_export.html into
/etc/geonode/templates.apps/oq-platform2

exposure_export.html is then referenced into the
/var/lib/openquake/oq-ui-api/etc/geonode/templates/oq-platform/includes/menu.html
&
/etc/geonode/templates/oq-platform/includes/menu.html
<li><a href="/oq-platform2/exposure_export.html">Exposure Country Aggregate Data</a></li>

then add the binding in django to the new exposure_export.html page in: /var/lib/geonode/src/GeoNodePy/geonode/urls.py

place the leaflet-legend.css into ~/Projects/test/oq-platform/oq-ui-api/etc/geonode/static/theme/
&
/etc/geonode/static/theme
&
/var/lib/openquake/oq-ui-api/etc/geonode/static/theme/
&
/var/www/geonode/static/theme/

add external libs with git submodule
place external libraries (Leaflet, Leaflet.Draw, Wax, L.Wax, Jquery) into: ~/Projects/test/oq-platform/oq-ui-client2/src & /var/www/geonode/static/oq-platform2/src/

Django:

new 'exposure' django project is added into: ~/Projects/test/oq-platform/oq-ui-api/geonode

new project is added into settings.py

an external database connection is made by adding to local_settings.py:

'geddb': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'ged',
            'USER': '<name>',
            'PASSWORD': '<passu>',
            'HOST': '<IP>',
            'PORT': <port>,
            'OPTIONS': {
                'sslmode': 'require',
      }
    }

and

DATABASE_ROUTERS = ['exposure.router.GedRouter']

the new project is referenced into the django root url.py with:

(r'^exposure/', include('geonode.exposure.urls')),

and

    url(r'^oq-platform2/exposure_export.html$', 'django.views.generic.simple.direct_to_template',
    {'template': 'oq-platform2/exposure_export.html'}, name='exposure_country'),