<s> from django import template <EOL> from django . contrib . staticfiles . storage import staticfiles_storage <EOL> from django . contrib . staticfiles import finders <EOL> from django . conf import settings <EOL> register = template . Library ( ) <EOL> @ register . simple_tag <EOL> def inline_css ( path ) : <EOL> if getattr ( settings , '<STR_LIT>' , False ) : <EOL> full_path = finders . find ( path ) <EOL> with open ( full_path , '<STR_LIT:rb>' ) as file : <EOL> return file . read ( ) <EOL> else : <EOL> with staticfiles_storage . open ( path ) as file : <EOL> return file . read ( ) </s>
