here is my view for login functionality
class LoginView(View):
def get(self, request):
return render(request, 'login.html')
def post(self, request):
print('in post')
data = {
'username': request.POST['username'],
'password': request.POST['password']
}
url = "http://127.0.0.1:8000/api/v1/login/"
response = requests.post(url, data=data)
print(response, 'res????')
if response.status_code == 200:
return redirect('dashboard')
return render(request, 'login.html')
my problem is that i got Forbidden (CSRF cookie not set.): /endpoint/
how can i configure csrf functionality to make successful call and get response from the api which is again developed in same application
thank you in advance !!
login.htmllooks like?