<s> from __future__ import absolute_import , unicode_literals <EOL> from django . template import Library <EOL> from wagtail . wagtailcore . models import Site <EOL> from . . context_processors import SettingsProxy <EOL> register = Library ( ) <EOL> @ register . simple_tag ( takes_context = True ) <EOL> def get_settings ( context , use_default_site = False ) : <EOL> if use_default_site : <EOL> site = Site . objects . get ( is_default_site = True ) <EOL> elif '<STR_LIT>' in context : <EOL> site = context [ '<STR_LIT>' ] . site <EOL> else : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> context [ '<STR_LIT>' ] = SettingsProxy ( site ) <EOL> return '<STR_LIT>' </s>
