def render_require_js_path_overrides(path_overrides):
 html = '<script type="text/javascript">\n        (function (require) {{\n          require.config({{\n              paths: {{\n                {overrides}\n            }}\n          }});\n        }}).call(this, require || RequireJS.require);\n    </script>'
 new_paths = []
 for module in path_overrides:
  actual_url = staticfiles_storage.url(path_overrides[module])
  path = actual_url.replace('.js', '').replace(django_settings.STATIC_URL, '')
  new_paths.append("'{module}': '{path}'".format(module=module, path=path))
 return html.format(overrides=',\n'.join(new_paths))

def render_require_js_path_overrides ( path_overrides ) : html = '<script type="text/javascript">\n        (function (require) {{\n          require.config({{\n              paths: {{\n                {overrides}\n            }}\n          }});\n        }}).call(this, require || RequireJS.require);\n    </script>' new_paths = [ ] for module in path_overrides : actual_url = staticfiles_storage . url ( path_overrides [ module ] ) path = actual_url . replace ( '.js' , '' ) . replace ( django_settings . STATIC_URL , '' ) new_paths . append ( "'{module}': '{path}'" . format ( module = module , path = path ) ) return html . format ( overrides = ',\n' . join ( new_paths ) )
render javascript to override default requirejs paths .