Skip to content
Advertisement

Django / Python: TypeError at / ‘NoneType’ object is not subscriptable

Errors showing in views.py at line data = cartData(request) and utils.py cartItems = cookieData['cartItems']

Errors showing exactly:

JavaScript

views.py

JavaScript

utils.py

JavaScript

Advertisement

Answer

Your return statement in cartData() function should not be inside the else block. It should be in level same as your if else.

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