#NEWLINE# @ register . tag #NEWLINE# def settings( parser , token ) : #NEWLINE# #INDENT# var_name = None #NEWLINE# try : #NEWLINE# #INDENT# ( tag_name , arg ) = token . contents . split ( None , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( ( '%r tag requires arguments' % token . contents . split ( ) [ 0 ] ) ) #NEWLINE# #UNINDENT# m = re . search ( '(.*?) as (\\w+)' , m ) #NEWLINE# if m : #NEWLINE# #INDENT# ( arg , var_name ) = m . groups ( ) #NEWLINE# #UNINDENT# if ( not ( ( arg [ 0 ] == arg [ ( - 1 ) ] ) and ( arg [ 0 ] in ( '"' , "'" ) ) ) ) : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( ( "%r tag's argument should be in quotes" % tag_name ) ) #NEWLINE# #UNINDENT# return ContextNode ( django_settings . get ( arg [ 1 : ( - 1 ) ] ) , var_name )