@ios_login_required()
def amiloggedinornot(request):
...
# equals to
def amiloggedinornot(request):
...
amiloggedinornot = ios_login_required()(amiloggedinornot)
You could see that ios_login_required
is invoked w/o any parameter whiles it needs a parameter f
.
Thus try something like (without ()
after @ios_login_required
):
@ios_login_required
def amiloggedinornot(request):
...
# which equals to
def amiloggedinornot(request):
...
amiloggedinornot = ios_login_required(amiloggedinornot)
You could read more about Python decorator here and here
Furthermore, user.is_authenticated
is a method, you need to call it to get the boolean result. not user.is_authenticated
will always be False
.