Basically when a POST request is made, I want to redirect to another page.
def sample(request):
if request.method != "POST":
return render(request,"user/sample.html")
else:
return redirect("https://www.djangoproject.com")
This code works fine when it receives a GET request but when I submit information, instead of redirecting to the page above, it appends the the template name into the url, Something like this :
http://localhost:8000/sample/sample
No matter what I type into the redirect(), even completely random things it still redirects to sample/sample
I've created multiple django-projects and in every one of them I still get this problem.