if you comment middleware csrf this is a risk security problem in your app
maybe you need read this part of documentation
https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#ajax
Cheers
On Sat, Jan 17, 2015 at 10:44 PM, Hossein Rashnoo wrote:
> I correct my code and it's worked. Thank you
I correct my code and it's worked. Thank you guys for your help.
Ajax Code:
function checkuser() {
var myObject = new Object();
myObject.username = $('#username').val();
myObject.password = $('#password').val();
$.ajax({
url: 'http://10.252.84.159/ajaxrecivelogin/',
Maybe it's triggering the CSRF validation? What error message are you
getting exactly from the server?
On Sat, Jan 17, 2015 at 10:37 AM, Erwin Sprengers
wrote:
> Hello,
>
> POST works fine for me, I use the following django code :
>
> at the end of the view :
>
> return HttpResponse(simplejson.
Hello,
POST works fine for me, I use the following django code :
at the end of the view :
return HttpResponse(simplejson.dumps(response_dict),
mimetype='application/javascript')
and following ajax code :
$.ajax({
url: '/ajax/is_key_mm/',
type: 'POST',
asy
I use this code to send a request:
function checkuser() {
$.ajax({
url: 'http://10.252.84.159/ajaxrecivelogin',
//type: 'POST',
data: "{'username': 'aa', 'password' : 'bb'}",
context: this,
dataType: 'json',
success: function (data) {
5 matches
Mail list logo