Reputation: 41
I am developing an API in Django and using next js as the frontend. But each time I try to call the back end to the next js fronend I get on the console
Access to XMLHttpRequest at 'http://127.0.0.1:8000/' from origin 'http://0.0.0.0:3000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `local`
I also get this
Login error:
AxiosError {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}
code
:
"ERR_NETWORK"
I did the following
]
and yet i still get the problem
Upvotes: 0
Views: 86
Reputation: 272
Have you done
INSTALLED_APPS = [
...,
"corsheaders",
...,
]
?
Upvotes: 0