I am writing a app using AJAX deployed by gunicorn and nginx on AWS.
It works very well when I am using python3 manage.py runserver
. But after I used gunicorn, the AJAX post doesn't work. I get a Failed to load resource: the server responded with a status of 404 (Not Found)
.
What I did is a very simple AJAX post
$.ajax({
type: 'POST',
url: '/analytical-tools/getData/',
data: {
'somedata':somedata
csrfmiddlewaretoken: '{{ csrf_token }}'
},
dataType: 'json',
success: function (data) {
/*do something*/
}
});
First I want to ask is is there any difference on AJAX when deployed on Gunicorn? And I want to ask how to debug on gunicorn. The gunicorn runs in the background and I can't see any debug information or print something when it is running.