Created
August 7, 2012 12:48
-
-
Save ZSchneidi/3285033 to your computer and use it in GitHub Desktop.
deco
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def login_required(self,fn): | |
def wrapped(): | |
session = request.environ.get('beaker.session') | |
if session.get("user",0): | |
return fn() | |
else: | |
return redirect("/login") | |
return wrapped | |
@self.login_required | |
@self.app.route('/') | |
def index(): | |
gc.collect() | |
return template('index', request=request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment