Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Cross-Origin Request Blocked #28

Description

@cnstlungu

Hi everyone.
I understand I'm doing something wrong, but I'm having trouble with setting up a Flask backend + Vue.js frontend.

I've added the Vue origins (port 8080) to CORS_ORIGIN_WHITELIST in settings.py, and was able to sign up and sign in. The problem occurs when I'm trying to add a new article.

I'm getting hit by the following error in the browser

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5000/api/articles. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

I've seen a couple of suggestions online (such a browser addon to bypass this), but would really appreciate if anyone knows the proper way to do this.

Regards

    CORS_ORIGIN_WHITELIST = [
        'http://0.0.0.0:4100',
        'http://localhost:4100',
        'http://0.0.0.0:8000',
        'http://localhost:8000',
        'http://0.0.0.0:4200',
        'http://localhost:4200',
        'http://0.0.0.0:4000',
        'http://localhost:4000',
	'http://localhost:8080',
	'http://0.0.0.0:8080'
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions