Cross-Origin Request Blocked

Hi everyone,

I run into Cors issues when I try to make some request to my API.

I have a private service witch contains my backend and my API build with django. The service adress is worldplantquiz-backend:10000. In my settings.py, I have allowed all cors origins CORS_ALLOW_ALL_ORIGINS = True. I access my different endpoints with the following url name : api/v1/[endpointname]

My frontend is on a webservice and build with Vue3. I use axios to make my API request. I’ve set the axios baseUrl to : axios.defaults.baseURL = "https://worldplantquiz-backend:10000/". When my components are mounted I make a request to a particular endpoint thanks to the following line of code : axios.get('api/v1/[endpointname]/')

I get the following error message : "Cross-Origin Request Blocked : The Same Origin Policy disallows reading the remote resource at 'https://worldplantquiz-backend:10000/api/v1/[endpointName]/'. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)"

Both services are on a paid starter tier, in the same project and in the same region. I’m running out of ideas of things to try to solve the issue. It’s my first deployment, I hope I’m not missing something really basic that may induce this problem.

Thanks in advance !

Would this answer to another issue may explain the one I encounter ? I try to call my private service from my front-end

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.