Decorator is simply a function that take another function as argument and manipulate it by adding functionalities etc. def expose(fn): if fn.__name__ == 'index': print fn('kamal') if fn.__name__ == 'test': print fn(80) fn() def html(fn): def _wrapper(): print "" print fn('kamal') print "" return _wrapper def index(name): return 'hello %s' % name @expose @html def test(param): return 'param is %s' % param