@register.inclusion_tag(u'admin/includes/dropdown_menu.html', takes_context=True)
def admin_dropdown_menu(context):
 template_vars = context.flatten()
 user = context[u'request'].user
 if user.is_staff:
  template_vars[u'dropdown_menu_app_list'] = admin_app_list(context[u'request'])
  if user.is_superuser:
   sites = Site.objects.all()
  else:
   try:
    sites = user.sitepermissions.sites.all()
   except ObjectDoesNotExist:
    sites = Site.objects.none()
  template_vars[u'dropdown_menu_sites'] = list(sites)
  template_vars[u'dropdown_menu_selected_site_id'] = current_site_id()
  template_vars[u'settings'] = context[u'settings']
  template_vars[u'request'] = context[u'request']
  return template_vars

@ register . inclusion_tag ( u'admin/includes/dropdown_menu.html' , takes_context = True ) def admin_dropdown_menu ( context ) : template_vars = context . flatten ( ) user = context [ u'request' ] . user if user . is_staff : template_vars [ u'dropdown_menu_app_list' ] = admin_app_list ( context [ u'request' ] ) if user . is_superuser : sites = Site . objects . all ( ) else : try : sites = user . sitepermissions . sites . all ( ) except ObjectDoesNotExist : sites = Site . objects . none ( ) template_vars [ u'dropdown_menu_sites' ] = list ( sites ) template_vars [ u'dropdown_menu_selected_site_id' ] = current_site_id ( ) template_vars [ u'settings' ] = context [ u'settings' ] template_vars [ u'request' ] = context [ u'request' ] return template_vars
renders the app list for the admin dropdown menu navigation .