memcache_admin/views.py
def dashboard(request):
    """
    Show the dashboard.
    """
    # mc_client will be a dict if memcached is not configured
    if not isinstance(mc_client, dict):
        cache_stats = _get_cache_stats()
    else:
        cache_stats = None
    if cache_stats:
        data = _context_data({
            'title': _('Memcache Dashboard'),
            'cache_stats': cache_stats,
            'can_get_slabs': hasattr(mc_client, 'get_slabs'),
            'REFRESH_RATE': SETTINGS['REFRESH_RATE'],
        },
            request)
        template = 'memcache_admin/dashboard.html'
    else:
        data = _context_data({
            'title': _('Memcache Dashboard - Error'),
            'error_message': _('Unable to connect to a memcache server.'),
        },
            request)
        template = 'memcache_admin/dashboard_error.html'
    return render_to_response(template, data, RequestContext(request))
def dashboard(request):
    # mc_client will be a dict if memcached is not configured
    if not isinstance(mc_client, dict):
        cache_stats = _get_cache_stats()
    else:
        cache_stats = None
    if cache_stats:
        data = _context_data({
            'title': _('Memcache Dashboard'),
            'cache_stats': cache_stats,
            'can_get_slabs': hasattr(mc_client, 'get_slabs'),
            'REFRESH_RATE': SETTINGS['REFRESH_RATE'],
        },
            request)
        template = 'memcache_admin/dashboard.html'
    else:
        data = _context_data({
            'title': _('Memcache Dashboard - Error'),
            'error_message': _('Unable to connect to a memcache server.'),
        },
            request)
        template = 'memcache_admin/dashboard_error.html'
    return render_to_response(template, data, RequestContext(request))
def dashboard ( request ) : # mc_client will be a dict if memcached is not configured if not isinstance ( mc_client , dict ) : cache_stats = _get_cache_stats ( ) else : cache_stats = None if cache_stats : data = _context_data ( { 'title' : _ ( 'Memcache Dashboard' ) , 'cache_stats' : cache_stats , 'can_get_slabs' : hasattr ( mc_client , 'get_slabs' ) , 'REFRESH_RATE' : SETTINGS [ 'REFRESH_RATE' ] , } , request ) template = 'memcache_admin/dashboard.html' else : data = _context_data ( { 'title' : _ ( 'Memcache Dashboard - Error' ) , 'error_message' : _ ( 'Unable to connect to a memcache server.' ) , } , request ) template = 'memcache_admin/dashboard_error.html' return render_to_response ( template , data , RequestContext ( request ) )
Show the dashboard.
Show the dashboard .