#NEWLINE# def get_base_url( request = None ) : #NEWLINE# #INDENT# base_url = getattr ( settings , 'WAGTAILAPI_BASE_URL' , ( request . site . root_url if request else None ) ) #NEWLINE# if base_url : #NEWLINE# #INDENT# base_url_parsed = urlparse ( base_url_parsed ) #NEWLINE# return ( ( base_url_parsed . scheme + '://' ) + base_url_parsed . netloc )