question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS_ORIGIN_WHITELIST is missing scheme or netloc

See original GitHub issue

CORS version: 3.0 OS: Ubuntu 16.04 LTS Django: 2.2.1

As soon as I started the server this error occurred:

django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: (corsheaders.E013) Origin 'localhost:3000' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
?: (corsheaders.E013) Origin 'localhost:8000' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
?: (corsheaders.E013) Origin 'localhost:8080' in CORS_ORIGIN_WHITELIST is missing scheme or netloc

System check identified 3 issues (0 silenced).

My settings file contains the following settings:

CORS_ORIGIN_WHITELIST = (
    'localhost:8000',
    'localhost:3000',
    'localhost:8080',
)

I’m using these exact settings in other apps with no issue on version 2.5.2. If I remove the items from this whitelist the errors go away.

Any insights appreciated. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

32reactions
michaelb072commented, May 13, 2019

I ran into this same issue, the errors go away with this:

CORS_ORIGIN_WHITELIST = [
    'http://localhost:3000',
    'http://localhost:8000',
    'http://localhost:8080',
]
5reactions
adamchainzcommented, May 13, 2019

I wrote a long changelog note about this: https://github.com/ottoyiu/django-cors-headers/blob/master/HISTORY.rst#300-2019-05-10 . Please refer to packages’ changelogs whenever you upgrade, and ensure you pin the versions you install in your requirements.txt.

@subodhjena I’ve noticed a bug there, that null shouldn’t be caught by the check, issue #404 will fix that, and I’ll release version 3.0.1 doing so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Localhost CORS not working
Here in this error the hint is clearly mentioning that it needs https:// HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com)....
Read more >
Maple installation failing CORS_ORIGIN_WHITELIST
E013) Origin 'lms.domain.tld:19010' in CORS_ORIGIN_WHITELIST is missing scheme or netloc HINT: Add a scheme (e.g. https://) or netloc …
Read more >
Django CORS Guide: What It Is and How to Enable It
Learn more about Django Cross-Origin Resource Sharing (CORS), what it is, why you should use it, and how to enable it in your...
Read more >
ERRORS: ?: (corsheaders.E013) Origin '*' in ...
E013) Origin '*' in CORS_ORIGIN_WHITELIST is missing scheme or netloc HINT: settings.py: #注释掉下面代码中黄色背景的那段,. 复制代码.
Read more >
How to Fix Django CORS Error - DZone Web Dev
Access to XMLHttpRequest at 'url'' from origin has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found