Shopify/sample-django-app

AttributeError at /api/products/, 'NoneType' object has no attribute 'startswith'

sillycube opened this issue · 5 comments

I can set up and open the app but it's giving me attribute error when I tried to open the endpoints /api/products/ & /api/orders/

It indicates that in shopify_app/decorators.py, line 16
authorization_header is None when it's passed to call startswith in session_token.py, line 44

Did I miss anything in the setup?

Also, please specify the supported Python versions in the docs
I was trying to get it up with python 3.8 but decorators.py is using removeprefix, which is only available in python 3.9.
I replace it with [0:8] and it's ok.

@sillycube how did you solve it? i found that HTTP_AUTHORIZATION is not present in headers using ngrok

@wellbranding I can only remember that I did a stupid thing about this issue. So I resolved and closed it after a while. Perhaps I didn't open the embedded app from the apps list?

@sillycube @wellbranding Hey, I'm trying to use the @session_token_required decorator for a view in home that has queries and I get the same error 'NoneType' object has no attribute 'startswith'. Should I find another way to activate a session to make API calls or is there a work around for this error.

@sillycube @wellbranding Hey, I'm trying to use the @session_token_required decorator for a view in home that has queries and I get the same error 'NoneType' object has no attribute 'startswith'. Should I find another way to activate a session to make API calls or is there a work around for this error.

You should update python version or change startWith with other function, quick google will do! Are you hobby programmer? :) Would be interesting to chat futher.

@wellbranding Sounds good I'll give those two a try and let you know if it works. Do you have Discord?