Flask/Flask-CORS: CORS header ‘Access-Control-Allow-Origin’ missing

后端 未结 1 1253
刺人心
刺人心 2021-01-28 11:48

I\'m trying to link a Flask backend, running locally on port 5000 with a Vue.js frontend, running locally on port 8080.

I\'m able to successfully signup and login, but f

1条回答
  •  佛祖请我去吃肉
    2021-01-28 12:21

    Have you tried adding the port to the localhost entry?

    #settings.py
        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',
            'http://127.0.0.1:8080',
            'http://192.168.100.6:8080',
            'localhost:8080'
        ]
    

    0 讨论(0)
提交回复
热议问题