Commit 65a07dd5 by Sébastien Hinderer

The LMS should serve favicon.ico also when a theme is enabled.

parent 4d22f572
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment