edx/edx-platform — pull request #3769 by shindere (2014-05-19 12:22:02+00:00)
Title: Improves the way LMS serves /favicon.ico

In the original code, the pattern for /favicon.ico is added to the
list of URL patterns only when no theme is enabled. This means that,
when /favicon.ico is requested on themed edX, one gets a 404 error.

This is a pity because there is already a FAVICON_PATH setting which
contains the path to the favicon and which already points to the
theme's one when a theme is enabled.

So this PR improves the way /favicon.ico is served in several ways:

1. The instruction adding the pattern to the list is moved outside of the
if not settings.FEATURES["USE_CUSTOM_THEME"] block, so that the pattern
gets added independently of whether a custom theme is enabled or not.

2. The redirection makes use of settings.STATIC_URL, instead of the
hard-coded '/static' used in the original code.

3. The microsites configuration is taken into account, so that if a
microsite provides its own favicon.ico, it will be that file which will be
returned. This is inspired by lms/templates/main.html.

4. The redirection uses the FAVICON_PATH setting. This setting is
theme-sensitive, so when a custom theme is enabled, FAVICON_PATH is
modified to point to the theme's favicon rather than to edX's one.
So the redirection now benefits from this already implemented behaviour.