def auth(func): def wrapper(request,args,**kwargs): user = request.session.get('username') if user : v = func(request,args,**kwargs) return v else: return redirect('/login.html') return wrapper