I have an error on the server (local host is OK)
from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I tried the following (followed this page How can I enable CORS on Django REST Framework)
pip install django-cors-headers
# Added at the top of MIDDLEWARE
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
# Added after allowed hosts
CORS_ORIGIN_ALLOW_ALL=True
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_CREDENTIALS = True
After the changes below I have
You can see the error in browser developer's mode VM87:5553 crbug/1173575, non-JS module files deprecated.
How can I fix the error?