[Django]-How do I fix the "bool object is not callabe" error in my Django website

1👍

TypeError: 'bool' object is not callable is shown when you are trying to behave an object like it is a method or function.

In your second line

if request.user.is_authenticated():

Change it to

if request.user.is_authenticated:

Because it’s not callable

1👍

The error is clear:

 TypeError: 'bool' object is not callable

You are using a bool variable as a function, according to the docs is_authenticated is an attribute.
To fix it just write:

if request.user.is_authenticated:

Leave a comment