<s> from django import template <EOL> from django . conf import settings <EOL> from django . core . cache import cache <EOL> from brubeck . weather . views import get_weather <EOL> register = template . Library ( ) <EOL> @ register . inclusion_tag ( '<STR_LIT>' ) <EOL> def render_weather_graphic ( ) : <EOL> """<STR_LIT>""" <EOL> weather = cache . get ( '<STR_LIT>' ) <EOL> if not weather : <EOL> try : <EOL> weather = get_weather ( ) <EOL> cache . set ( '<STR_LIT>' , weather , <NUM_LIT> * <NUM_LIT:20> ) <EOL> except : <EOL> weather = None <EOL> return { <EOL> '<STR_LIT>' : settings . MEDIA_URL , <EOL> '<STR_LIT>' : weather <EOL> } </s>
