We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unsupported browser template does not use theme styling
### Observed behavior
The unsupported browser template uses static css in the template - mostly this is fine, but the colours used in there are Kolibri default theme colours, not those drawn from the currently loaded theme plugin.

### Expected behavior
Should use the themes defined by the currently active theme hook.

### User-facing consequences
Custom themes might look odd for unsupported browsers.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kolibri/core/views.py`
Content:
```
1 from django.contrib.auth import logout
2 from django.core.urlresolvers import reverse
3 from django.http import Http404
4 from django.http import HttpResponse
5 from django.http import HttpResponseRedirect
6 from django.shortcuts import redirect
7 from django.urls import is_valid_path
8 from django.urls import translate_url
9 from django.utils.decorators import method_decorator
10 from django.utils.six.moves.urllib.parse import urlsplit
11 from django.utils.six.moves.urllib.parse import urlunsplit
12 from django.utils.translation import check_for_language
13 from django.utils.translation import LANGUAGE_SESSION_KEY
14 from django.utils.translation import ugettext_lazy as _
15 from django.views.decorators.http import require_POST
16 from django.views.generic.base import TemplateView
17 from django.views.generic.base import View
18 from django.views.i18n import LANGUAGE_QUERY_PARAMETER
19 from django.views.static import serve
20 
21 from kolibri.core.auth.constants import user_kinds
22 from kolibri.core.auth.models import Role
23 from kolibri.core.decorators import cache_no_user_data
24 from kolibri.core.device.hooks import SetupHook
25 from kolibri.core.device.translation import get_accept_headers_language
26 from kolibri.core.device.translation import get_device_language
27 from kolibri.core.device.translation import get_settings_language
28 from kolibri.core.device.utils import allow_guest_access
29 from kolibri.core.device.utils import device_provisioned
30 from kolibri.core.hooks import LogoutRedirectHook
31 from kolibri.core.hooks import RoleBasedRedirectHook
32 
33 
34 # Modified from django.views.i18n
35 @require_POST
36 def set_language(request):
37     """
38     Since this view changes how the user will see the rest of the site, it must
39     only be accessed as a POST request. If called as a GET request, it will
40     error.
41     """
42     lang_code = request.POST.get(LANGUAGE_QUERY_PARAMETER)
43     next_url = urlsplit(request.POST.get("next")) if request.POST.get("next") else None
44     if lang_code and check_for_language(lang_code):
45         if next_url and is_valid_path(next_url.path):
46             # If it is a recognized Kolibri path, then translate it to the new language and return it.
47             next_path = urlunsplit(
48                 (
49                     next_url[0],
50                     next_url[1],
51                     translate_url(next_url[2], lang_code),
52                     next_url[3],
53                     next_url[4],
54                 )
55             )
56         else:
57             next_path = translate_url(reverse("kolibri:core:redirect_user"), lang_code)
58         response = HttpResponse(next_path)
59         if hasattr(request, "session"):
60             request.session[LANGUAGE_SESSION_KEY] = lang_code
61     else:
62         lang_code = (
63             get_device_language()
64             or get_accept_headers_language(request)
65             or get_settings_language()
66         )
67         if next_url and is_valid_path(next_url.path):
68             # If it is a recognized Kolibri path, then translate it using the default language code for this device
69             next_path = urlunsplit(
70                 (
71                     next_url[0],
72                     next_url[1],
73                     translate_url(next_url[2], lang_code),
74                     next_url[3],
75                     next_url[4],
76                 )
77             )
78         else:
79             next_path = translate_url(reverse("kolibri:core:redirect_user"), lang_code)
80         response = HttpResponse(next_path)
81         if hasattr(request, "session"):
82             request.session.pop(LANGUAGE_SESSION_KEY, "")
83     return response
84 
85 
86 def logout_view(request):
87     logout(request)
88     if LogoutRedirectHook.is_enabled():
89         return HttpResponseRedirect(
90             next(obj.url for obj in LogoutRedirectHook.registered_hooks)
91         )
92     return HttpResponseRedirect(reverse("kolibri:core:redirect_user"))
93 
94 
95 def get_urls_by_role(role):
96     for hook in RoleBasedRedirectHook.registered_hooks:
97         if role in hook.roles:
98             yield hook.url
99 
100 
101 def get_url_by_role(role):
102     obj = next(
103         (hook for hook in RoleBasedRedirectHook.registered_hooks if role in hook.roles),
104         None,
105     )
106 
107     if obj:
108         return obj.url
109 
110 
111 class GuestRedirectView(View):
112     def get(self, request):
113         """
114         Redirects a guest user to a learner accessible page.
115         """
116         if allow_guest_access():
117             return HttpResponseRedirect(get_url_by_role(user_kinds.LEARNER))
118         return RootURLRedirectView.as_view()(request)
119 
120 
121 device_is_provisioned = False
122 
123 
124 def is_provisioned():
125     # First check if the device has been provisioned
126     global device_is_provisioned
127     device_is_provisioned = device_is_provisioned or device_provisioned()
128     return device_is_provisioned
129 
130 
131 class RootURLRedirectView(View):
132     def get(self, request):
133         """
134         Redirects user based on the highest role they have for which a redirect is defined.
135         """
136         # If it has not been provisioned and we have something that can handle setup, redirect there.
137         if not is_provisioned() and SetupHook.provision_url:
138             return redirect(SetupHook.provision_url())
139 
140         if request.user.is_authenticated():
141             url = None
142             if request.user.is_superuser:
143                 url = url or get_url_by_role(user_kinds.SUPERUSER)
144             roles = set(
145                 Role.objects.filter(user_id=request.user.id)
146                 .values_list("kind", flat=True)
147                 .distinct()
148             )
149             if user_kinds.ADMIN in roles:
150                 url = url or get_url_by_role(user_kinds.ADMIN)
151             if user_kinds.COACH in roles or user_kinds.ASSIGNABLE_COACH in roles:
152                 url = url or get_url_by_role(user_kinds.COACH)
153             url = url or get_url_by_role(user_kinds.LEARNER)
154         else:
155             url = get_url_by_role(user_kinds.ANONYMOUS)
156         if url:
157             return HttpResponseRedirect(url)
158         raise Http404(
159             _(
160                 "No appropriate redirect pages found. It is likely that Kolibri is badly configured"
161             )
162         )
163 
164 
165 @method_decorator(cache_no_user_data, name="dispatch")
166 class UnsupportedBrowserView(TemplateView):
167     template_name = "kolibri/unsupported_browser.html"
168 
169 
170 class StatusCheckView(View):
171     def get(self, request):
172         """
173         Confirms that the server is up
174         """
175         return HttpResponse()
176 
177 
178 def static_serve_with_fallbacks(search_paths):
179     """
180     Serve a static file by iterating over search_paths until a matching file is found.
181     If a matching file is not found on any of the paths, a 404 will be raised.
182     """
183 
184     def serve_func(request, path, document_root=None):
185 
186         for search_path in search_paths:
187             try:
188                 return serve(request, path, document_root=search_path)
189             except Http404:
190                 pass
191 
192         # allow the Http404 to be raised, since we couldn't find the file anywhere
193         return serve(request, path, document_root=search_paths[0])
194 
195     return serve_func
196
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/kolibri/core/views.py b/kolibri/core/views.py
--- a/kolibri/core/views.py
+++ b/kolibri/core/views.py
@@ -29,6 +29,10 @@
 from kolibri.core.device.utils import device_provisioned
 from kolibri.core.hooks import LogoutRedirectHook
 from kolibri.core.hooks import RoleBasedRedirectHook
+from kolibri.core.theme_hook import BRAND_COLORS
+from kolibri.core.theme_hook import COLOR_V400
+from kolibri.core.theme_hook import PRIMARY
+from kolibri.core.theme_hook import ThemeHook
 
 
 # Modified from django.views.i18n
@@ -166,6 +170,16 @@
 class UnsupportedBrowserView(TemplateView):
     template_name = "kolibri/unsupported_browser.html"
 
+    def get_context_data(self, **kwargs):
+        context = super(UnsupportedBrowserView, self).get_context_data(**kwargs)
+        context["brand_primary_v400"] = (
+            ThemeHook.get_theme()
+            .get(BRAND_COLORS, {})
+            .get(PRIMARY, {})
+            .get(COLOR_V400, "purple")
+        )
+        return context
+
 
 class StatusCheckView(View):
     def get(self, request):

{"golden_diff": "diff --git a/kolibri/core/views.py b/kolibri/core/views.py\n--- a/kolibri/core/views.py\n+++ b/kolibri/core/views.py\n@@ -29,6 +29,10 @@\n from kolibri.core.device.utils import device_provisioned\n from kolibri.core.hooks import LogoutRedirectHook\n from kolibri.core.hooks import RoleBasedRedirectHook\n+from kolibri.core.theme_hook import BRAND_COLORS\n+from kolibri.core.theme_hook import COLOR_V400\n+from kolibri.core.theme_hook import PRIMARY\n+from kolibri.core.theme_hook import ThemeHook\n \n \n # Modified from django.views.i18n\n@@ -166,6 +170,16 @@\n class UnsupportedBrowserView(TemplateView):\n     template_name = \"kolibri/unsupported_browser.html\"\n \n+    def get_context_data(self, **kwargs):\n+        context = super(UnsupportedBrowserView, self).get_context_data(**kwargs)\n+        context[\"brand_primary_v400\"] = (\n+            ThemeHook.get_theme()\n+            .get(BRAND_COLORS, {})\n+            .get(PRIMARY, {})\n+            .get(COLOR_V400, \"purple\")\n+        )\n+        return context\n+\n \n class StatusCheckView(View):\n     def get(self, request):\n", "issue": "Unsupported browser template does not use theme styling\n### Observed behavior\r\nThe unsupported browser template uses static css in the template - mostly this is fine, but the colours used in there are Kolibri default theme colours, not those drawn from the currently loaded theme plugin.\r\n\r\n### Expected behavior\r\nShould use the themes defined by the currently active theme hook.\r\n\r\n### User-facing consequences\r\nCustom themes might look odd for unsupported browsers.\r\n\n", "before_files": [{"content": "from django.contrib.auth import logout\nfrom django.core.urlresolvers import reverse\nfrom django.http import Http404\nfrom django.http import HttpResponse\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import redirect\nfrom django.urls import is_valid_path\nfrom django.urls import translate_url\nfrom django.utils.decorators import method_decorator\nfrom django.utils.six.moves.urllib.parse import urlsplit\nfrom django.utils.six.moves.urllib.parse import urlunsplit\nfrom django.utils.translation import check_for_language\nfrom django.utils.translation import LANGUAGE_SESSION_KEY\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views.decorators.http import require_POST\nfrom django.views.generic.base import TemplateView\nfrom django.views.generic.base import View\nfrom django.views.i18n import LANGUAGE_QUERY_PARAMETER\nfrom django.views.static import serve\n\nfrom kolibri.core.auth.constants import user_kinds\nfrom kolibri.core.auth.models import Role\nfrom kolibri.core.decorators import cache_no_user_data\nfrom kolibri.core.device.hooks import SetupHook\nfrom kolibri.core.device.translation import get_accept_headers_language\nfrom kolibri.core.device.translation import get_device_language\nfrom kolibri.core.device.translation import get_settings_language\nfrom kolibri.core.device.utils import allow_guest_access\nfrom kolibri.core.device.utils import device_provisioned\nfrom kolibri.core.hooks import LogoutRedirectHook\nfrom kolibri.core.hooks import RoleBasedRedirectHook\n\n\n# Modified from django.views.i18n\n@require_POST\ndef set_language(request):\n    \"\"\"\n    Since this view changes how the user will see the rest of the site, it must\n    only be accessed as a POST request. If called as a GET request, it will\n    error.\n    \"\"\"\n    lang_code = request.POST.get(LANGUAGE_QUERY_PARAMETER)\n    next_url = urlsplit(request.POST.get(\"next\")) if request.POST.get(\"next\") else None\n    if lang_code and check_for_language(lang_code):\n        if next_url and is_valid_path(next_url.path):\n            # If it is a recognized Kolibri path, then translate it to the new language and return it.\n            next_path = urlunsplit(\n                (\n                    next_url[0],\n                    next_url[1],\n                    translate_url(next_url[2], lang_code),\n                    next_url[3],\n                    next_url[4],\n                )\n            )\n        else:\n            next_path = translate_url(reverse(\"kolibri:core:redirect_user\"), lang_code)\n        response = HttpResponse(next_path)\n        if hasattr(request, \"session\"):\n            request.session[LANGUAGE_SESSION_KEY] = lang_code\n    else:\n        lang_code = (\n            get_device_language()\n            or get_accept_headers_language(request)\n            or get_settings_language()\n        )\n        if next_url and is_valid_path(next_url.path):\n            # If it is a recognized Kolibri path, then translate it using the default language code for this device\n            next_path = urlunsplit(\n                (\n                    next_url[0],\n                    next_url[1],\n                    translate_url(next_url[2], lang_code),\n                    next_url[3],\n                    next_url[4],\n                )\n            )\n        else:\n            next_path = translate_url(reverse(\"kolibri:core:redirect_user\"), lang_code)\n        response = HttpResponse(next_path)\n        if hasattr(request, \"session\"):\n            request.session.pop(LANGUAGE_SESSION_KEY, \"\")\n    return response\n\n\ndef logout_view(request):\n    logout(request)\n    if LogoutRedirectHook.is_enabled():\n        return HttpResponseRedirect(\n            next(obj.url for obj in LogoutRedirectHook.registered_hooks)\n        )\n    return HttpResponseRedirect(reverse(\"kolibri:core:redirect_user\"))\n\n\ndef get_urls_by_role(role):\n    for hook in RoleBasedRedirectHook.registered_hooks:\n        if role in hook.roles:\n            yield hook.url\n\n\ndef get_url_by_role(role):\n    obj = next(\n        (hook for hook in RoleBasedRedirectHook.registered_hooks if role in hook.roles),\n        None,\n    )\n\n    if obj:\n        return obj.url\n\n\nclass GuestRedirectView(View):\n    def get(self, request):\n        \"\"\"\n        Redirects a guest user to a learner accessible page.\n        \"\"\"\n        if allow_guest_access():\n            return HttpResponseRedirect(get_url_by_role(user_kinds.LEARNER))\n        return RootURLRedirectView.as_view()(request)\n\n\ndevice_is_provisioned = False\n\n\ndef is_provisioned():\n    # First check if the device has been provisioned\n    global device_is_provisioned\n    device_is_provisioned = device_is_provisioned or device_provisioned()\n    return device_is_provisioned\n\n\nclass RootURLRedirectView(View):\n    def get(self, request):\n        \"\"\"\n        Redirects user based on the highest role they have for which a redirect is defined.\n        \"\"\"\n        # If it has not been provisioned and we have something that can handle setup, redirect there.\n        if not is_provisioned() and SetupHook.provision_url:\n            return redirect(SetupHook.provision_url())\n\n        if request.user.is_authenticated():\n            url = None\n            if request.user.is_superuser:\n                url = url or get_url_by_role(user_kinds.SUPERUSER)\n            roles = set(\n                Role.objects.filter(user_id=request.user.id)\n                .values_list(\"kind\", flat=True)\n                .distinct()\n            )\n            if user_kinds.ADMIN in roles:\n                url = url or get_url_by_role(user_kinds.ADMIN)\n            if user_kinds.COACH in roles or user_kinds.ASSIGNABLE_COACH in roles:\n                url = url or get_url_by_role(user_kinds.COACH)\n            url = url or get_url_by_role(user_kinds.LEARNER)\n        else:\n            url = get_url_by_role(user_kinds.ANONYMOUS)\n        if url:\n            return HttpResponseRedirect(url)\n        raise Http404(\n            _(\n                \"No appropriate redirect pages found. It is likely that Kolibri is badly configured\"\n            )\n        )\n\n\n@method_decorator(cache_no_user_data, name=\"dispatch\")\nclass UnsupportedBrowserView(TemplateView):\n    template_name = \"kolibri/unsupported_browser.html\"\n\n\nclass StatusCheckView(View):\n    def get(self, request):\n        \"\"\"\n        Confirms that the server is up\n        \"\"\"\n        return HttpResponse()\n\n\ndef static_serve_with_fallbacks(search_paths):\n    \"\"\"\n    Serve a static file by iterating over search_paths until a matching file is found.\n    If a matching file is not found on any of the paths, a 404 will be raised.\n    \"\"\"\n\n    def serve_func(request, path, document_root=None):\n\n        for search_path in search_paths:\n            try:\n                return serve(request, path, document_root=search_path)\n            except Http404:\n                pass\n\n        # allow the Http404 to be raised, since we couldn't find the file anywhere\n        return serve(request, path, document_root=search_paths[0])\n\n    return serve_func\n", "path": "kolibri/core/views.py"}], "after_files": [{"content": "from django.contrib.auth import logout\nfrom django.core.urlresolvers import reverse\nfrom django.http import Http404\nfrom django.http import HttpResponse\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import redirect\nfrom django.urls import is_valid_path\nfrom django.urls import translate_url\nfrom django.utils.decorators import method_decorator\nfrom django.utils.six.moves.urllib.parse import urlsplit\nfrom django.utils.six.moves.urllib.parse import urlunsplit\nfrom django.utils.translation import check_for_language\nfrom django.utils.translation import LANGUAGE_SESSION_KEY\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.views.decorators.http import require_POST\nfrom django.views.generic.base import TemplateView\nfrom django.views.generic.base import View\nfrom django.views.i18n import LANGUAGE_QUERY_PARAMETER\nfrom django.views.static import serve\n\nfrom kolibri.core.auth.constants import user_kinds\nfrom kolibri.core.auth.models import Role\nfrom kolibri.core.decorators import cache_no_user_data\nfrom kolibri.core.device.hooks import SetupHook\nfrom kolibri.core.device.translation import get_accept_headers_language\nfrom kolibri.core.device.translation import get_device_language\nfrom kolibri.core.device.translation import get_settings_language\nfrom kolibri.core.device.utils import allow_guest_access\nfrom kolibri.core.device.utils import device_provisioned\nfrom kolibri.core.hooks import LogoutRedirectHook\nfrom kolibri.core.hooks import RoleBasedRedirectHook\nfrom kolibri.core.theme_hook import BRAND_COLORS\nfrom kolibri.core.theme_hook import COLOR_V400\nfrom kolibri.core.theme_hook import PRIMARY\nfrom kolibri.core.theme_hook import ThemeHook\n\n\n# Modified from django.views.i18n\n@require_POST\ndef set_language(request):\n    \"\"\"\n    Since this view changes how the user will see the rest of the site, it must\n    only be accessed as a POST request. If called as a GET request, it will\n    error.\n    \"\"\"\n    lang_code = request.POST.get(LANGUAGE_QUERY_PARAMETER)\n    next_url = urlsplit(request.POST.get(\"next\")) if request.POST.get(\"next\") else None\n    if lang_code and check_for_language(lang_code):\n        if next_url and is_valid_path(next_url.path):\n            # If it is a recognized Kolibri path, then translate it to the new language and return it.\n            next_path = urlunsplit(\n                (\n                    next_url[0],\n                    next_url[1],\n                    translate_url(next_url[2], lang_code),\n                    next_url[3],\n                    next_url[4],\n                )\n            )\n        else:\n            next_path = translate_url(reverse(\"kolibri:core:redirect_user\"), lang_code)\n        response = HttpResponse(next_path)\n        if hasattr(request, \"session\"):\n            request.session[LANGUAGE_SESSION_KEY] = lang_code\n    else:\n        lang_code = (\n            get_device_language()\n            or get_accept_headers_language(request)\n            or get_settings_language()\n        )\n        if next_url and is_valid_path(next_url.path):\n            # If it is a recognized Kolibri path, then translate it using the default language code for this device\n            next_path = urlunsplit(\n                (\n                    next_url[0],\n                    next_url[1],\n                    translate_url(next_url[2], lang_code),\n                    next_url[3],\n                    next_url[4],\n                )\n            )\n        else:\n            next_path = translate_url(reverse(\"kolibri:core:redirect_user\"), lang_code)\n        response = HttpResponse(next_path)\n        if hasattr(request, \"session\"):\n            request.session.pop(LANGUAGE_SESSION_KEY, \"\")\n    return response\n\n\ndef logout_view(request):\n    logout(request)\n    if LogoutRedirectHook.is_enabled():\n        return HttpResponseRedirect(\n            next(obj.url for obj in LogoutRedirectHook.registered_hooks)\n        )\n    return HttpResponseRedirect(reverse(\"kolibri:core:redirect_user\"))\n\n\ndef get_urls_by_role(role):\n    for hook in RoleBasedRedirectHook.registered_hooks:\n        if role in hook.roles:\n            yield hook.url\n\n\ndef get_url_by_role(role):\n    obj = next(\n        (hook for hook in RoleBasedRedirectHook.registered_hooks if role in hook.roles),\n        None,\n    )\n\n    if obj:\n        return obj.url\n\n\nclass GuestRedirectView(View):\n    def get(self, request):\n        \"\"\"\n        Redirects a guest user to a learner accessible page.\n        \"\"\"\n        if allow_guest_access():\n            return HttpResponseRedirect(get_url_by_role(user_kinds.LEARNER))\n        return RootURLRedirectView.as_view()(request)\n\n\ndevice_is_provisioned = False\n\n\ndef is_provisioned():\n    # First check if the device has been provisioned\n    global device_is_provisioned\n    device_is_provisioned = device_is_provisioned or device_provisioned()\n    return device_is_provisioned\n\n\nclass RootURLRedirectView(View):\n    def get(self, request):\n        \"\"\"\n        Redirects user based on the highest role they have for which a redirect is defined.\n        \"\"\"\n        # If it has not been provisioned and we have something that can handle setup, redirect there.\n        if not is_provisioned() and SetupHook.provision_url:\n            return redirect(SetupHook.provision_url())\n\n        if request.user.is_authenticated():\n            url = None\n            if request.user.is_superuser:\n                url = url or get_url_by_role(user_kinds.SUPERUSER)\n            roles = set(\n                Role.objects.filter(user_id=request.user.id)\n                .values_list(\"kind\", flat=True)\n                .distinct()\n            )\n            if user_kinds.ADMIN in roles:\n                url = url or get_url_by_role(user_kinds.ADMIN)\n            if user_kinds.COACH in roles or user_kinds.ASSIGNABLE_COACH in roles:\n                url = url or get_url_by_role(user_kinds.COACH)\n            url = url or get_url_by_role(user_kinds.LEARNER)\n        else:\n            url = get_url_by_role(user_kinds.ANONYMOUS)\n        if url:\n            return HttpResponseRedirect(url)\n        raise Http404(\n            _(\n                \"No appropriate redirect pages found. It is likely that Kolibri is badly configured\"\n            )\n        )\n\n\n@method_decorator(cache_no_user_data, name=\"dispatch\")\nclass UnsupportedBrowserView(TemplateView):\n    template_name = \"kolibri/unsupported_browser.html\"\n\n    def get_context_data(self, **kwargs):\n        context = super(UnsupportedBrowserView, self).get_context_data(**kwargs)\n        context[\"brand_primary_v400\"] = (\n            ThemeHook.get_theme()\n            .get(BRAND_COLORS, {})\n            .get(PRIMARY, {})\n            .get(COLOR_V400, \"purple\")\n        )\n        return context\n\n\nclass StatusCheckView(View):\n    def get(self, request):\n        \"\"\"\n        Confirms that the server is up\n        \"\"\"\n        return HttpResponse()\n\n\ndef static_serve_with_fallbacks(search_paths):\n    \"\"\"\n    Serve a static file by iterating over search_paths until a matching file is found.\n    If a matching file is not found on any of the paths, a 404 will be raised.\n    \"\"\"\n\n    def serve_func(request, path, document_root=None):\n\n        for search_path in search_paths:\n            try:\n                return serve(request, path, document_root=search_path)\n            except Http404:\n                pass\n\n        # allow the Http404 to be raised, since we couldn't find the file anywhere\n        return serve(request, path, document_root=search_paths[0])\n\n    return serve_func\n", "path": "kolibri/core/views.py"}]}