0

The log file contains warnings about "Unauthorized" access to certain API URLs. The warning's indicator says "[django.request:230]", and I suppose it means the trigger is line 230 of a source code file related to django.request. However, I'm unfamiliar with Django and PyCharm IDE, so I couldn't find out exactly which file.

I hope to find out the root cause of this warning message and address it. Any hints will be highly appreciated.

Log events:

[03/Feb/2021 09:54:07] WARNING [django.request:230] Unauthorized: /api/rest-auth/user/
[03/Feb/2021 09:54:07] WARNING [django.request:230] Unauthorized: /api/products/meta/debt/
[03/Feb/2021 09:54:07] WARNING [django.request:230] Unauthorized: /api/products/meta/reg/
Ben
  • 2,348
  • 1
  • 20
  • 23
James
  • 1,373
  • 3
  • 13
  • 27
  • 1
    Are you using Django Rest Framework? It looks like your user isn't logged in when trying to access those urls. – Ben Feb 09 '21 at 18:43
  • Thank you, @Ben. Yes, you're right. I just tested and it was just tests on the URL without logging in. Is there a way to suppress the this kind of warning messages in log? – James Feb 09 '21 at 19:20
  • Almost always a way to do something, take a look here for ideas: https://stackoverflow.com/questions/11029717/how-do-i-disable-log-messages-from-the-requests-library – Ben Feb 09 '21 at 19:25

0 Answers0