2👍
✅
You shouldn’t do it like that. You should always redirect after a POST anyway; so here you just redirect back to ‘home’.
from django.shortcuts import redirect
...
return redirect('home')
The register branch should be a redirect as well, of course.
Source:stackexchange.com