-- decorator는 함수다.
------------------------------------------------------------------------------
>>> def dec_fnc(fnc):
        def inner_fnc():
            print("inner fnc")
            fnc()
        return inner_fnc

>>> def my_fnc():
        print("my_fnc")


>>> fnc = dec_fnc(my_fnc)
>>> fnc
<function dec_fnc.<locals>.inner_fnc at 0x03A0E618> <- return된 함수는 inner_fnc다.

>>> fnc()
inner fnc
my_fnc
 

-- 이걸 decorator로 쓰면
------------------------------------------------------------------------------
>>> def dec_fnc(fnc):
        def inner_fnc():
            print("inner fnc")
            fnc()
        return inner_fnc


>>> @dec_fnc
def my_fnc():
    print("my_fnc")


>>> my_fnc()
inner fnc
my_fnc


-- decorator 함수가 한번더 중첩된 함수라면 인자있는 decorator로 쓰이기도 한다.
ex) 
@dec_fnc(3)
def my_fnc():
	blabla~~~

 

Refer to below url
https://ssungkang.tistory.com/entry/Django-FBV-%EC%99%80-CBV-%EC%9D%98-decorators-%EC%82%AC%EC%9A%A9%EB%B2%95?category=320582