Skip to content
Advertisement

AttributeError: ‘tuple’ object has no attribute ‘model’. How to fix this error?

I’m new to Django. Please help me to solve this error. I’m not getting any solution. I tried many stackoverflow solutions and GitHub solutions but I’m not getting where the error is coming from.

urls.py

JavaScript

models.py

JavaScript

views.py

JavaScript

serializers.py

JavaScript

Exception log

JavaScript

Here is the github link of the app – Django

I tried many stackoverflow solutions but I am not understanding from where the error is coming from…

Advertisement

Answer

Not sure but I think the issue is with extra commas in both the views, they make it act as a tuple, see it correctly so it should be:

JavaScript

Kindly remove them.

Also, in imgUrl field there must be max_length in UserProfile model.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement