dotja/authentication_app_react_django_rest

Blocked by CORS policy

Opened this issue · 2 comments

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