Hi, I'm using Django and I have a simple ajax call made thru jQuery for an autocomplete field. The errors I get in my console are the following.
Origin https://gen709.pythonanywhere.com is not allowed by Access-Control-Allow-Origin. Status code: 404
and
XMLHttpRequest cannot load https://www.pythonanywhere.com/canadiannutrientfile/search/foodname/?lang=fr&term=p due to access control checks.
here is part of my ajax call
$("#food_name").keyup(function(){
console.log("keyup")
$.ajax({url: "/canadiannutrientfile/search/foodname/",
dataType: "json",
data:'lang=fr&term='+$(this).val(),
I ve also tried
$.ajax({url: "https://gen709.pythonanywhere.com/canadiannutrientfile/search/foodname/"
in both instances the actual URL used is
https://www.pythonanywhere.com/canadiannutrientfile/search/foodname/?lang=fr&term=p
when I paste the good URL
https://gen709.pythonanywhere.com/canadiannutrientfile/search/foodname/?lang=fr&term=p
I guet the the expected server's response. Am I receiving the Access-Control-Allow-Origin because of the domaine switch and why is there a domaine switch in the first place
Thanks you very much