(corsheaders.E014) Origin 'http://localhost:4200/' in CORS_ORIGIN_WHITELIST should not have path .Im getting this error.
CORS_ORIGIN_WHITELIST = ( 'http://localhost:4200/', )
Origin 'http://localhost:4200/' in CORS_ORIGIN_WHITELIST should not have path .Im getting this error.
django-cors-headers is a Django application for handling the server headers required for Cross-Origin Resource Sharing (CORS).
CORS_ALLOWED_ORIGINS is the list of origins authorized to make requests. For example, below I've specified four origins: Django. CORS_ALLOWED_ORIGINS = [ "https://domain.com", "https://api.domain.com", "http://localhost:8080", "http://127.0.0.1:9000" ]
Remove the slash (/
) from the end of the line (after the number 4200), leaving it as:
CORS_ORIGIN_WHITELIST = ( 'http://localhost:4200', )
That should make it work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With