Harsha Jasti Harsha Jasti - 6 months ago 40
AngularJS Question

not able to call python file output using angularjs

I am very new to angularjs.
I am working on a code where depending on the output of the python file, the angularjs file should react differently.
I keep getting this particular error

angular.js:10765 GET http://harsha.seq-technology.in/ajax/duplicate_check.py?q=0 500 (Internal Server Error)


what am i doing wrong ?
my script file is as below:

$scope.save_me = function () {
$scope.dup_yes=1;
console.log("here");
$http.get("/ajax/duplicate_check.py",{params{"q":0}}).then(function(response) {
console.log("here2");
console.log(response.data);

if (response.data['login_status'] == 1 ){
console.log("Mission is a Success\n");
}
})
}


my python file gives the output as follows:

Content-Type: application/json

{"login_status": 1}


Help is greatly appreciated.

Answer

This has nothing to do with angularjs, first be sure you make your "script" return a proper HTTP response with a 200 result code.

You can curl or wget to debug the result before doing anything else.

Comments