@register.function
def inline_css(bundle, media=False, debug=None):
 if (debug is None):
  debug = getattr(settings, 'DEBUG', False)
 if debug:
  items = [_get_compiled_css_url(i) for i in settings.MINIFY_BUNDLES['css'][bundle]]
 else:
  items = [('css/%s-min.css' % bundle)]
 if (not media):
  media = getattr(settings, 'CSS_MEDIA_DEFAULT', 'screen,projection,tv')
 contents = []
 for css in items:
  if is_external(css):
   return _build_html([css], ('<link rel="stylesheet" media="%s" href="%%s" />' % media))
  with open(get_path(css), 'r') as f:
   css_content = f.read()
   css_parsed = re.sub('url\\(([^)]*?)\\)', _relative_to_absolute, css_content)
   contents.append(css_parsed)
 return _build_html(contents, ('<style type="text/css" media="%s">%%s</style>' % media))

@ register . function def inline_css ( bundle , media = False , debug = None ) : if ( debug is None ) : debug = getattr ( settings , 'DEBUG' , False ) if debug : items = [ _get_compiled_css_url ( i ) for i in settings . MINIFY_BUNDLES [ 'css' ] [ bundle ] ] else : items = [ ( 'css/%s-min.css' % bundle ) ] if ( not media ) : media = getattr ( settings , 'CSS_MEDIA_DEFAULT' , 'screen,projection,tv' ) contents = [ ] for css in items : if is_external ( css ) : return _build_html ( [ css ] , ( '<link rel="stylesheet" media="%s" href="%%s" />' % media ) ) with open ( get_path ( css ) , 'r' ) as f : css_content = f . read ( ) css_parsed = re . sub ( 'url\\(([^)]*?)\\)' , _relative_to_absolute , css_content ) contents . append ( css_parsed ) return _build_html ( contents , ( '<style type="text/css" media="%s">%%s</style>' % media ) )
if we are in debug mode .