You shouldn't upload Data to the server via "GET". That is what the "POST" method is for.
According to the HTTP/1.1 Spec:
The POST method is used to request that the origin server accept the
entity enclosed in the request as a new subordinate of the resource
identified by the Request-URI in the Request-Line
In other words, POST is used to create.
It doesn't matter if you think your data is sensitive or not. By implementing a way to alter data on the server, you are automatically offering a way that can be misused by anyone. Hence, all such interfaces have to be treated with the same thoroughness in terms of security.
Your question doesn't provide anything about what you want to to with the transferred data. Do you want to store it persistently in a database or is the data only relevant for the user during his current visit?
Basically you are offered three ways:
1. persistent storage.
You will store the data in your database.
In this case you should use a form with the aforementioned "post" method.
#your_template.html
<form method="post" action="<your action">
<!-- do something -->
{{ form }}
</form>
#your_view.py
def your_view(request):
if request.method == 'POST':
form = YourForm(request.POST)
if form.is_valid(): # All validation rules pass
# Process the data in form.cleaned_data
# ...
return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
form = YourForm() # An unbound form
return render(request, 'your_template.html', {
'form': form,
})
See https://docs.djangoproject.com/en/dev/topics/forms/ for more information about django forms
2. temporary storage.
you are not required to store any of these results persistently, so you can use the session mechanism of django, which will allow you to pass around data which will be just valid while a specific user is visiting your page. You can adjust the time to live of session objects
See https://docs.djangoproject.com/en/dev/topics/http/sessions/ for more information about django sessions
3. client based storage.
Go all the way to the client and use cookies which will be stored on the clients machine and are just read by the server. But you have to be extra thorough while evaluating cookie values.
See Django Cookies, how can I set them? for a little cookie helper for django and take it from there