I don't know if it's a bug or a feature, but when I'm on my home page with the contact form anchor
(url = http://localhost:8000/#contact
)
After submitting the form, all of these will redirect including the #contact
anchor name and I cannot get rid of it:
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.shortcuts import redirect
# Following 3 lines all send back to http://localhost:8000/#contact
return HttpResponseRedirect(reverse('homepage'))
return redirect(reverse('homepage'))
return redirect('/')
# As a test, the following line redirects to http://localhost:8000/account/email/#contact
return HttpResponseRedirect(reverse('account:email'))
I found some people with the opposite issue, trying to add the anchor name, but can't find a related question with my issue