Skip to content Skip to sidebar Skip to footer

Django-cors-headers Cors_origin_whitelist Tuple Vs String Issue

I'm trying to use django-cors-headers for my project. It appears when I set CORS_ORIGIN_WHITELIST as a string it works fine. But when I use it as a tuple it doesn't work. Any idea

Solution 1:

I was having this same problem. I believe the issue has to do with string encoding. If you change your whitelist to the following it should work for you:

CORS_ORIGIN_WHITELIST = (
    u'http://localhost:8888',
    u'http://127.0.0.1:8000',
)

Unfortunately I don't have a "why" for you, but at least this should get you going.

Post a Comment for "Django-cors-headers Cors_origin_whitelist Tuple Vs String Issue"