Django rest framework API, web request prompt 403 error

  1. you can get data normally by using postman request.
  2. request using web page with error message:

{"detail": "CSRF Failed: CSRF cookie not set."}

how to solve this?


first check in the browser to see if there is a csrftoken cookie,. If not, you need to see why the cookie is not set, such as whether the django.middleware.csrf.CsrfViewMiddleware is deleted in the MIDDLEWARE.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38643-2ae53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38643-2ae53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?