Questions tagged [flask-cors]

A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.

https://flask-cors.readthedocs.io/

82 questions
0
votes
2 answers

No 'Access-Control-Allow-Origin' header is present on the requested resource (FLASK API / ReactJs)

I'm implementing a vegetable retail price predicting web application for one of my university projects using Flask and ReactJs. My POST requests work fine on Postman, but when I try to use a form in ReactJs to make a POST request, I get the…
Hashini
  • 79
  • 9
0
votes
1 answer

Enabling CORS Python in Google Cloud Platform Function

I've followed a few Medium articles as well as Google's own tutorials and still can't get CORS enabled using flask on this function :( What code am I missing to enable CORS? I want wildcard of * as I want all services/ domains to be able to access…
0
votes
0 answers

Flask-cors not working with jwt authorization

I use Vue + axios + Flask and trying to connect Flask-CORS with jwt auth when click to /about but get an error: Access to XMLHttpRequest at 'https://127.0.0.1:5000/about' from origin 'http://localhost:8080' has been blocked by CORS policy: Response…
Ilya A
  • 51
  • 4
0
votes
0 answers

How to prevent current_user in flask_login from getting reset?

I am using flask app as a backend server for my react frontend. In the flask app, I have setup LoginManager(app) and I have a @login_manager.user_loader, all setup according to the flask documentation. With a print statement I make sure, that the…
0
votes
1 answer

Session field is None

I have hosted a rest API written in Flask in one domain and my react app in another domain in azure app services. I can successfully log into the system using a username and password. However, when I try to hit an endpoint, I get None for the…
dragsu
  • 91
  • 1
  • 1
  • 8
0
votes
2 answers

Chrome says CORS headers are missing even when I can see them in network logs

I hate to be the guy to ask yet another CORS question, but I'm honestly stumped. Chrome is telling me that the Access-Control-Allow-Origin header is missing, but I can see it right there in the response headers for the OPTION request. What's weird…
SeaChange
  • 67
  • 8
0
votes
0 answers

Headers are ignored in cross-site POST request in Python-Flask

I am trying to make a cross site POST request. My front-end is react native (javascript), and my backend is in Flask. Everything works with GET requests. But None of my POST requests work when some specific headers are required. Here is my…
Abilys38
  • 303
  • 4
  • 16
0
votes
1 answer

Flask python API CORS issue from Angular

I have Flask Python API with cors set up as below. It works fine when invoked from browser. But getting CORS error when called from Angular application currently testing from localhost:4200. From Chrome developer tools - Could see preflight request…
Mohan Rayapuvari
  • 195
  • 1
  • 1
  • 12
0
votes
2 answers

Problem sending/storing session cookie with Vue Axios (CORS)

I cant for some reason store the session cookie from my Flask-backend (port 5000) and send it as credentials from my Vue-frontend (port 8082) via Axios. I create a global axios on the frontend, then login to get the session cookie, and then try to…
0
votes
2 answers

Receiving CORS policy error when submitting form from Angular to flask application

I have tried several things but I am not able to figure this one out. I have a back-end flask app and a front-end client written in Angular. When I submit my register user form I get a cors error. I have read the documentation for flask_cors and…
rf guy
  • 227
  • 4
  • 17
0
votes
1 answer

Axios POST is not parsed correctly in Python Flask

Intro Hi, I can see this question asked multiple times, but not a proper solution. whats wrong GET requests are working as expected. but if I use Vue.js and Axios to send a POST request to a flask server. POST with JSON sent with Postman also…
toti
  • 173
  • 1
  • 7
0
votes
3 answers

How to allow CORS in google cloud run?

I have a react microservice (via nginx) deployed onto google cloud run with its environment variable for the backend set to another google cloud run instance that's running gunicorn which is serving the backend. My Flask app is set up following…
0
votes
2 answers

Docker ModuleNotFoundError even though this module is not included in code anymore

I have written a Flask API which I want to run in a docker container. However, Error: While importing "api", an ImportError was raised: keeps coming up even though the module which is not found is no longer in the code. After the error occurred, I…
0
votes
1 answer

Python Flask unable to get past CORS

I have the following script written in python from flask import Flask, request, jsonify from flask_cors import CORS, cross_origin app = Flask(__name__) CORS(app, resources=r'/chat', headers='Content-Type') @app.route("/chat") def chat(): …
PrestonDocks
  • 3,706
  • 8
  • 33
  • 59
0
votes
3 answers

AJAX Request CORS Policy error with Flask

I'm using Flask to build a simple backoffice. I'm trying to make some requests on client-side using AJAX, but it is always throwing me the following error: access to XMLHttpRequest at 'http://10.11.0.123/...' from origin 'http://localhost:5000' has…
Miguel Andrade
  • 156
  • 1
  • 11