@webauth.SecurityCheck
@csrf.ensure_csrf_cookie
def Homepage(request):
 renderers_js_files = set(['statistics.js', 'usage.js'])
 create_time = psutil.Process(os.getpid()).create_time()
 context = {'heading': config_lib.CONFIG['AdminUI.heading'], 'report_url': config_lib.CONFIG['AdminUI.report_url'], 'help_url': config_lib.CONFIG['AdminUI.help_url'], 'use_precompiled_js': config_lib.CONFIG['AdminUI.use_precompiled_js'], 'renderers_js': renderers_js_files, 'timestamp': create_time}
 response = shortcuts.render_to_response('base.html', context, context_instance=template.RequestContext(request))
 request.REQ = request.GET.dict()
 request.token = BuildToken(request, 60)
 user_record = aff4.FACTORY.Create(aff4.ROOT_URN.Add('users').Add(request.user), aff4_type=aff4_users.GRRUser, mode='r', token=request.token)
 canary_mode = user_record.Get(user_record.Schema.GUI_SETTINGS).canary_mode
 if canary_mode:
  response.set_cookie('canary_mode', 'true')
 else:
  response.delete_cookie('canary_mode')
 return response

@ webauth . SecurityCheck @ csrf . ensure_csrf_cookie def Homepage ( request ) : renderers_js_files = set ( [ 'statistics.js' , 'usage.js' ] ) create_time = psutil . Process ( os . getpid ( ) ) . create_time ( ) context = { 'heading' : config_lib . CONFIG [ 'AdminUI.heading' ] , 'report_url' : config_lib . CONFIG [ 'AdminUI.report_url' ] , 'help_url' : config_lib . CONFIG [ 'AdminUI.help_url' ] , 'use_precompiled_js' : config_lib . CONFIG [ 'AdminUI.use_precompiled_js' ] , 'renderers_js' : renderers_js_files , 'timestamp' : create_time } response = shortcuts . render_to_response ( 'base.html' , context , context_instance = template . RequestContext ( request ) ) request . REQ = request . GET . dict ( ) request . token = BuildToken ( request , 60 ) user_record = aff4 . FACTORY . Create ( aff4 . ROOT_URN . Add ( 'users' ) . Add ( request . user ) , aff4_type = aff4_users . GRRUser , mode = 'r' , token = request . token ) canary_mode = user_record . Get ( user_record . Schema . GUI_SETTINGS ) . canary_mode if canary_mode : response . set_cookie ( 'canary_mode' , 'true' ) else : response . delete_cookie ( 'canary_mode' ) return response
basic handler to render the index page .