jQuery ajax call made to instead of user.pythonanywhere .com

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 is not allowed by Access-Control-Allow-Origin. Status code: 404


XMLHttpRequest cannot load due to access control checks.

here is part of my ajax call

$.ajax({url: "/canadiannutrientfile/search/foodname/",  
dataType: "json",

I ve also tried

$.ajax({url: ""

in both instances the actual URL used is

when I paste the good URL

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

Did you reload your web app after you changed your code to $.ajax({url: "" ?

Yes I did to no avail

Are you sure that the browser is not caching your pages? Maybe do hard refresh.

Also did that same message

Access to XMLHttpRequest at '****/canadiannutrientfile/search/foodname/?lang=fr&term=p' from origin '****' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Anything else?

Perhaps you could view the source of your web page to see if somewhere you've accidentally put where you meant to put You could also try using the browser's JavaScript debugger to step through and see if you can find out where it's coming from.

I've had a similar problem when running my program using chrome or firefox. When I run the same code on my phone it works as expected.

Check the network tab of your browser's developer tools to see what is happening to the requests.