Commit 54399533 by James Tauber

Merge pull request #3769 from shindere/favicon-fixup

Improves the way LMS serves /favicon.ico
parents a053dfbb 65a07dd5
...@@ -5,6 +5,8 @@ from django.conf.urls.static import static ...@@ -5,6 +5,8 @@ from django.conf.urls.static import static
import django.contrib.auth.views import django.contrib.auth.views
from microsite_configuration import microsite
# Uncomment the next two lines to enable the admin: # Uncomment the next two lines to enable the admin:
if settings.DEBUG or settings.FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'): if settings.DEBUG or settings.FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'):
admin.autodiscover() admin.autodiscover()
...@@ -106,6 +108,14 @@ urlpatterns += ( ...@@ -106,6 +108,14 @@ urlpatterns += (
{'template': '404.html'}, name="404"), {'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 # Semi-static views only used by edX, not by themes
if not settings.FEATURES["USE_CUSTOM_THEME"]: if not settings.FEATURES["USE_CUSTOM_THEME"]:
urlpatterns += ( urlpatterns += (
...@@ -125,10 +135,7 @@ if not settings.FEATURES["USE_CUSTOM_THEME"]: ...@@ -125,10 +135,7 @@ if not settings.FEATURES["USE_CUSTOM_THEME"]:
# Press releases # Press releases
url(r'^press/([_a-zA-Z0-9-]+)$', 'static_template_view.views.render_press_release', name='press_release'), 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 # Only enable URLs for those marketing links actually enabled in the
# settings. Disable URLs by marking them as None. # 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