def get_template_request_context(request=None):
 if (request is None):
  request = get_current_request()
 if (request is None):
  return None
 request_cache_dict = request_cache.get_cache('edxmako')
 cache_key = 'request_context'
 if (cache_key in request_cache_dict):
  return request_cache_dict[cache_key]
 context = RequestContext(request)
 context['is_secure'] = request.is_secure()
 context['site'] = safe_get_host(request)
 for processor in get_template_context_processors():
  context.update(processor(request))
 request_cache_dict[cache_key] = context
 return context

def get_template_request_context ( request = None ) : if ( request is None ) : request = get_current_request ( ) if ( request is None ) : return None request_cache_dict = request_cache . get_cache ( 'edxmako' ) cache_key = 'request_context' if ( cache_key in request_cache_dict ) : return request_cache_dict [ cache_key ] context = RequestContext ( request ) context [ 'is_secure' ] = request . is_secure ( ) context [ 'site' ] = safe_get_host ( request ) for processor in get_template_context_processors ( ) : context . update ( processor ( request ) ) request_cache_dict [ cache_key ] = context return context
returns the template processing context to use for the current request .