def log(): if session.get('user') is None: return redirect('/') topn = request.args.get('topn', 10) topn = int(topn) if str(topn).isdigit() else 10 access_file_path = "/home/kk/www_access_20140823.log" result = models.get_topn(access_file_path, topn) return render_template('log.html', logs=result)
def log(): if session.get('user') is None: return redirect('/') #logfile='/root/www.log' logfile = '/home/kk/class11/fangj/www.log' topn = request.args.get('topn',10) logs = models.get_topn(logfile,int(str(topn))) return render_template('log.html',log = logs)
def log(): topn = request.args.get('topn', 10) topn = int(topn) if str(topn).isdigit() else 10 access_file_path = "/home/share/www_access_20140823.log" result = models.get_topn(access_file_path, topn) return render_template('log.html', logs=result)