authentication_app_react_django_rest
authentication_app_react_django_rest copied to clipboard
Blocked by CORS policy
Hello.
When I submit the form I get the following error: Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/register' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Please help to solve the problem
I think the problem is the SECRET_key into .env file. The settings.py file can't read this file so if you print the SECRET_KEY value is none
@birtasu
I solved it by: https://stackoverflow.com/a/30956822