def sessions(request): c = db.cursor() c.execute('SELECT session_key FROM scryer_pageviews ' 'GROUP BY session_key ORDER BY MAX(served) DESC ' 'LIMIT 10') session_keys = c.fetchall() sessions = [ pageviews.get_session(sk) for sk, in session_keys ] return render_to_response('scryer/sessions', request, locals())
def view_session(request, session_key): session = pageviews.get_session(session_key) if not session: raise Http404() return render_to_response('scryer/view_session', request, session)