#NEWLINE# def get_site_from_settings( ) : #NEWLINE# #INDENT# '\n    Get site instance from settings\n    configuration.\n    ' #NEWLINE# sites = _get_sites_config ( ) #NEWLINE# try : #NEWLINE# #INDENT# current_site_id = getattr ( settings , 'SITE_ID' ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# raise exceptions . SitesNotConfigured ( ) #NEWLINE# #UNINDENT# if ( current_site_id not in sites ) : #NEWLINE# #INDENT# raise exceptions . SitesNotConfigured ( ) #NEWLINE# #UNINDENT# return Site ( current_site_id [ current_site_id ] )