gem/oq-platform — pull request #228 by daniviga (2014-09-02 12:20:36+00:00)
Title: Add oq_context_processor to all renders

Currently we are including a custom context in templates explicitly in the ```urls.py```:

```python
url(r'^isc_viewer/$', OQTemplateView.as_view(
template_name="isc_viewer.html"), name='isc_viewer'),
url(r'^ghec_viewer/$', OQTemplateView.as_view(
template_name="ghec_viewer.html"), name='ghec_viewer'),
url(r'^geodetic/$', OQTemplateView.as_view(
template_name="geodetic.html"), name='geodetic'),
```

We need it to populate some js variables (bing, tilestream, third party urls). This does not work for the original GeoNode stuff (i.e. ```/maps```) since we are just including the original urls.py from those applications

```python
# Layer views
(r'^layers/', include('geonode.layers.urls')),
# Map views
(r'^maps/', include('geonode.maps.urls')),
```

This PR creates a custom context processor (see https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATE_CONTEXT_PROCESSORS) which is called every ```render_to_response```, so we don't have to deal with ```urls.py```.

The old method will be removed in the future and the ```urls.py``` cleaned.