Say, I've got 2 views in views.py: Fetching_information_view and Processing_view.
In Fetching_information_view I am fetching information which I am displaying to the user in the tabular format on the "home.html" page. That's all okay.
Now, I get a CSV URL for each row as well. I don't want that when the user clicks on the CSV URL it should open the CSV; instead, when the user clicks on it then it should go to the Processing_view and it should be served on a different HTML page, say "process.html".
CSV URL:
/some_bucket/some_csv_file.csv?AWSAccessKeyId=some_id&Expires=1234&Signature=some_signature
Desired URL:
http://example.com/process.html?file=some_bucket/some_csv_file.csv?AWSAccessKeyId=some_id&Expires=1234&Signature=some_signature
Now, how can I call Processing_view from the Fetching_information_view view and send the file information? It should process in the backend and display results on process.html.
This is the table I am showing on the homepage:
I've wrote sample code for views.py which I'm using:
def process_data(request):
# what should come here?
# Display in process.html
def home(request):
some_data = SomeTable.objects.filter(user = request.user)
args = {"some_data": some_data}
# display as table on home.html, including URLs it is carrying
return render(request, "home.html", args)

process_viewfor yourprocess_dataview, in your template "home.html" you can just puthref="{% url 'process_view' %}?id={{id}}"to append theidof the object to your request.GET. In the process view you fetch the model with that id and the associated CSV url and file parameters.