diff --git a/ckan/config/environment.py b/ckan/config/environment.py index 47751d095a7..74a2a01e4cd 100644 --- a/ckan/config/environment.py +++ b/ckan/config/environment.py @@ -142,6 +142,10 @@ def find_controller(self, controller): 'ckan.site_id for SOLR search-index rebuild to work.' config['ckan.site_id'] = ckan_host + # ensure that a favicon has been set + favicon = config.get('ckan.favicon', '/images/icons/ckan.ico') + config['ckan.favicon'] = favicon + # Init SOLR settings and check if the schema is compatible #from ckan.lib.search import SolrSettings, check_solr_schema_version search.SolrSettings.init(config.get('solr_url'), diff --git a/ckan/config/routing.py b/ckan/config/routing.py index fc01216ec4e..02eb3a3d92c 100644 --- a/ckan/config/routing.py +++ b/ckan/config/routing.py @@ -316,6 +316,9 @@ def make_map(): for plugin in routing_plugins: map = plugin.after_map(map) + # sometimes we get requests for favicon.ico we should redirect to + # the real favicon location. + map.redirect('/favicon.ico', config.get('ckan.favicon')) map.redirect('/*(url)/', '/{url}', _redirect_code='301 Moved Permanently') diff --git a/ckan/templates/base.html b/ckan/templates/base.html index 7e15f119db1..b1a892f7e81 100644 --- a/ckan/templates/base.html +++ b/ckan/templates/base.html @@ -12,7 +12,7 @@ <py:if test="title">${title} - </py:if>CKAN - + ${select('*[local-name()!="title"]')}