I have a view which requires a user to be logged in. It writes some data to the database so I look for the form submission using request.method == 'POST'
The flow goes like this: If users are not logged in, they're redirected to the login page. After logging in, I then redirect them to my initial view using the next
parameter. The problem is that the redirect is no longer a POST but a GET.
How do I make this request a POST? Should I use some other pattern to do this?
EDIT: Here's the kind of view that I have:
@login_required
def some_view(request):
if request.method == 'POST':
# Do something
return HttpResponseRedirect('some_url')