def get_context_dict(context):
 if isinstance(context, RequestContext):
  ctx = {}
  map(ctx.update, context.dicts)
 else:
  ctx = context
 return ctx

def get_context_dict ( context ) : if isinstance ( context , RequestContext ) : ctx = { } map ( ctx . update , context . dicts ) else : ctx = context return ctx
contexts in django version 1 .