I
I
IIITRIX2018-10-26 22:29:12
Django
IIITRIX, 2018-10-26 22:29:12

How to fix Response for preflight is invalid (redirect)?

I get user data through rest
in the console

Failed to load http://127.0.0.1:8000/api/user/username: Response for preflight is invalid (redirect)

If you go to 127.0.0.1:8000/api/user/username api opens and works fine
The data is not displayed
in the django config
CORS_ORIGIN_ALLOW_ALL = True
CORS_ORIGIN_WHITELIST = (
  'localhost:3000',
)

Where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Zharov, 2018-10-26
@IIITRIX

Looks like a problem with cors. Either dig django settings, or install some kind of browser extension https://chrome.google.com/webstore/detail/allow-co...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question