From 65a07dd52cce066ccb083353979e26dadc2f388e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Mon, 19 May 2014 13:56:14 +0200 Subject: [PATCH] The LMS should serve favicon.ico also when a theme is enabled. --- lms/urls.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lms/urls.py b/lms/urls.py index e62dbef42b..cc74d0c1ad 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -5,6 +5,8 @@ from django.conf.urls.static import static import django.contrib.auth.views +from microsite_configuration import microsite + # Uncomment the next two lines to enable the admin: if settings.DEBUG or settings.FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'): admin.autodiscover() @@ -106,6 +108,14 @@ urlpatterns += ( {'template': '404.html'}, name="404"), ) +# Favicon +favicon_path = microsite.get_value('favicon_path', settings.FAVICON_PATH) +urlpatterns += (( + r'^favicon\.ico$', + 'django.views.generic.simple.redirect_to', + {'url': settings.STATIC_URL + favicon_path} +),) + # Semi-static views only used by edX, not by themes if not settings.FEATURES["USE_CUSTOM_THEME"]: urlpatterns += ( @@ -125,10 +135,7 @@ if not settings.FEATURES["USE_CUSTOM_THEME"]: # Press releases url(r'^press/([_a-zA-Z0-9-]+)$', 'static_template_view.views.render_press_release', name='press_release'), - - # Favicon - (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/static/images/favicon.ico'}), - ) +) # Only enable URLs for those marketing links actually enabled in the # settings. Disable URLs by marking them as None.