1👍
✅
Seems to me that you need to specify a parameter name in your data map. So, instead of:
$.get(this.href, { request.user: request.user }, function(data){
You would have:
$.get(this.href, { parameter_name : request.user }, function(data){
Where parameter_name is the name of the get variable the page you are requesting expects to receive.
Take a look at the jQuery docs, about midway down the page:
1👍
There is a problem with the syntax used to pick up the variables. You’ll need two curly brackets to pick up the variable in the template. Something like this: {{ request.user }}
.
However I am not sure that you can include it directly as there is an obvious clash with the JS syntax. You might want to collect {{ request.user }}
into a variable and then use it in the dictionary.
- [Answered ]-In Django, a way for user to upload file to server, then move to Amazon S3?
- [Answered ]-Django field to select range between two values?
- [Answered ]-How can I make generic View only accept POST or GET
- [Answered ]-Django, Python datetime.now() and storing the timezones
Source:stackexchange.com