path('login/', oauth.InstagramLoginView.as_view(), name='instagram_login'), class InstagramLoginView(View) def get(self, request): client_id = settings.INSTAGRAM_CLIENT_ID print("client id", client_id) redirect_uri = "http://localhost:8000/api/hello-world/" # Replace with your actual redirect URI scope = "user_profile,user_media" # Adjust scopes as needed url = f"https://api.instagram.com/oauth/authorize/?client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}&response_type=code" return redirect(url)