Hi Madhav,

On 23/05/2020 09.03, Madhav Nandan wrote:
Hello all,

I was making an eCommerce web application using Django 2.X.

I'm getting TYPE ERROR at /login/:
here screenshots are attached, help me resolve issues:

I did make all the required changes, however, I don't find how to get rid of this.


Try to look at the actual error message. It is quite helpful and this is really simple. It is pointing at line 39 of your views.py where you have:

print(request.user.is_authenticated())

And telling you that a 'bool' object is not callable.

A callable object is something like a function and it does indeed look like you are calling is_authenticated as a function. Try this:

foo = True
foo()

TypeError: 'bool' object is not callable

Looks familiar right?

So you cannot "call" a bool object which is what you are trying to do. So maybe you should call it but simply test its value instead like you would normally do for bool objects?

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4629dc34-569a-de91-9714-ba2f5faf11a4%40stacktrace.dk.

Reply via email to