[Answer]-Django โ€“ pre-set request.DATA in a variable that won't change

1๐Ÿ‘

โœ…

Have a look at Python doc about binding.

In your case you are not making a independent copy of request.DATA in data_full, but you are only making another bind to the same dict.

To accomplish what you want to do try something like this:

 data_full = dict(request.DATA)

In this way you are building a new, independent dict with the same data. This article explains very well the concept and is worth a reading.

Leave a comment