from django.conf.urls import url
from djangae.utils import djangae_webapp

from django.views.decorators.csrf import csrf_exempt

try:
    from mapreduce.main import create_handlers_map
    wrapped_urls = [url(url_re.replace('.*/', '^', 1), csrf_exempt(djangae_webapp(func))) for url_re, func in create_handlers_map()]
except ImportError as e:
    wrapped_urls = []


urlpatterns = wrapped_urls

@@ -122,16 +122,357 @@
 exempt%0A%0A
+# The Mapreduce status UI uses inline JS, which will fail If we have django-csp%0A# installed and are not allowing 'unsafe-inline' as a SCRIPT_SRC.%0Atry:%0A    from csp.decorators import csp_update%0A    exempt_from_unsafe_inline = csp_update(SCRIPT_SRC=(%22'unsafe-inline'%22,))%0Aexcept ImportError:%0A    exempt_from_unsafe_inline = lambda func: func%0A%0A%0A
 try:%0A   
@@ -543,12 +543,34 @@
  = %5B
-url(
+%0A        url(%0A            
 url_
@@ -596,16 +596,55 @@
 %5E', 1), 
+%0A            exempt_from_unsafe_inline(
 csrf_exe
@@ -669,16 +669,35 @@
 (func)))
+%0A        ) %0A       
  for url
@@ -730,16 +730,21 @@
 rs_map()
+%0A    
 %5D%0Aexcept

Allow the Mapreduce status UI to function when a CSP is enforced with django-csp.