12👍
✅
You could work with the request path attribute and add that to your form’s action attribute, like so:
<form method="post" action="/tell-a-friend?return_url={{ request.path }}">
...
</form>
Then, in your tell-a-friend view, HttpResponseRedirect to the return_url
query parameter.
1👍
It looks like maybe you are using APPEND_SLASH which will do a redirect if you don’t have a slash. Try changing the button link to sample.com/emailafriend/
, note the ending slash.
- Django-mptt get_descendants for a list of nodes
- When is it appropriate to use Django context processors?
- Django queryset order_by dates near today
- Django – check if list contains something in a template
- Best Practice for Context Processors vs. Template Tags?
0👍
Maybe simply pass sample.com/about as GET or POST param? Or even through session.
Source:stackexchange.com