Amend the product_display.html View link by adding a query paramater '?next={{ request.path }}' This adds a query parameter named "next" with the value set to the current page's URL (request.path)
In the product_detail.html, use the following structure to retrieve the previous page from the 'next' query:
The bag is fixed by following two steps: