'Error validating in instagram api login with django

hi i have a problem in instagram api login im doing all that right as doc said but i have this error :

Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request

its redirect once but when i want to make a post request it didnt work :

@api_view(["GET"])
def insta_call_back(request):
    code = request.query_params.get("code")
    user_id = request.query_params.get("state")
   data = {
       "client_id": settings.INSTAGRAM.get("client_id"),
       "client_secret": settings.INSTAGRAM.get("client_secret"),
       "grant_type": "authorization_code",
       "redirect_uri": f"{settings.ONLINE_URL}api/insta_call_back",
      "code": code

 }
  resp = requests.post("https://api.instagram.com/oauth/access_token/", data=data)
 return Response({
    "resp": resp.text
  })

i write this code in python django



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source