Forums

My device is Forbitten

I have a web app running in pythonanywhere, while i was working on my project, debugging, all of a sudden only my device a mobile phone was not able to request my API, i checked on my PC it works.

So i checked my errors.log it shows my mobile is forbitten: 2023-02-05 09:05:39,944: Forbidden: /api/login/

I only has a free account. And i am stuck, please help me fix this. Thank u.

That is your web app returning the forbidden response, so you will need to debug what is different about the request from your device and your computer that causes it to return that. You can start by adding some logging to the view to see what is being passed to it.

"POST /api/login/ HTTP/1.1" 403 63 "-" "okhttp/4.9.2"

Forbidden: /api/login/

it always come after a row of bad requests do u have any idea why it is...

i think this might be something to do with the firewall or something of pythonanywhere.com, if yes its obviously a good think, but since i am a developer debugging i realy wants it to allow me. I have been stuck in this for so long, pls help.

That just looks like the client (okhttp) has not properly authenticated with your site. Perhaps you have old auth details for that or the user and password that you are trying to use do not exist on your PythonAnywhere site.