Why does my JavaScript code receive a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, while Postman does not?

Mod note: This question is about why XMLHttpRequest/fetch/etc. on the browser are subject to the Same Access Policy restrictions (you get errors mentioning CORB or CORS) while Postman is not....

How to enable CORS in flask

I am trying to make a cross origin request using jquery but it keeps being reject with the message XMLHttpRequest cannot load http://... No 'Access-Control-Allow-Origin' header is present on the...

Solve Cross Origin Resource Sharing with Flask

For the following ajax post request for Flask (https://stackoverflow.com/questions/14908864/how-can-i-use-data-posted-from-ajax-in-flask): $.ajax({ url: "http://127.0.0.1:5000/foo", type:...

flask socketio CORS

I've been trying to send data from flask over socket io. I need to access this data from a different origin, but it is giving a CORS error. I have tried using all kinds of cross origin stuff and...

one hot encoding for frequent values only

I am looking to do one hot encoding to a column, but only for those that are very frequent. All that are below a threshold T will be put in their own category. My strategy was to create a...

Flask TypeError 'is not JSON serializable' - nested dictionary

i am using Flask as framework for my server, and while returning a response i get the following error: > Traceback (most recent call last): File "C:\Python27\lib\site-packages\flask\app.py",...

Python connexion not displaying Swagger UI

I've built a Python/Flask based REST API using the connexion module. This working well as defining the REST API with with swagger.yml file works very well. The application is running, but when I...

Problems with flask and bad request

I was programming myself a pretty nice api to get some json data from my gameserver to my webspace using json, but everytime i am sending a request using angular i am getting this: 127.0.0.1 - -...

Flask app broken after bson update in Heroku

I have a Flask app that uses mongoengine and running on Heroku, init I use the bson package and after I updateded it from 0.5.6 to 0.5.7 I started getting the following error message: [2018-11-23...

POST /api/sendimage 400 (BAD REQUEST) Flask restful API from browser

I am using Python 3.6.3 Flask==1.0.2 Flask-Cors==3.0.7 Flask-RESTful==0.3.7 for making an API which is used to collect tiff image using post method and save it locally. api = Api(app) CORS(app) ...

Python: why do I get an error when I import geopandas?

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

Flask-SocketIO and 400 Bad Request

I'm running a Flask application with socketio to deal with notifications. The Flask app is listening at port 5000 and the client is in 8080. the js client is always getting this error: VM15520:1...

WEBP support not installed error with Pillow included in Anaconda

I have written a small code to open webp image in the Anaconda prompt. from PIL import Image im = Image.open('test.webp') It causes the following...

Install from pipfile using pipenv install gives error

I have a project where I'm trying to install from the pipfile using pipenv install. I get som error when installing. Before i describe the error, this is what I did: Reinstall pipenv Reinstall...

Flask app wont launch 'ImportError: cannot import name 'cached_property' from 'werkzeug' '

I've been working on a Flask app for a few weeks. I finished it today and went to deploy it... and now it won't launch. I haven't added or removed any code so assume something has changed in the...

Flask Session does not hold any value between Requests

I'm a rookie web developer and I am trying to implement a Flask + React app. In React, I have a form that asks for user_id and password. After the user enters the required data, React (Axios)...

CSS not recognized when served with FastAPI

I have a FastAPI app built and an index, css and js file that work when opened directly, but I can't get the css file to show up when being served with FastAPI. I've tried troubleshooting in case...

issue with flask-cors - blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status

I'm a newbie in flask and angular please bear with me. I've been stuck with an issue about CORS. I've applied different code fixes just to make it work. Now the error that I am getting is Access...

vue.config.js (devServer) not used in npm run serve

I'm trying to set up a reverse proxy on the development server for my VUE js webapp to get around the CORS issue that I was getting when I was trying to use my flask HTTP APIs with the vue js...

Axios returns index.html content to frontend (React.js)

I am trying to build a web application where I am using React.js for frontend and Flask as the backend. I tried to establish a connection between the frontend and the backend by stating the proxy...

Why is react 'stl-viewer' not loading my stl file served by my private custom python flask api

If this is not the right place to ask this, please let me know. Some Background: I have a python / flask API that will serve relevant data and an STL file on request. CORS is enabled as required....

Why is Flask-Cors not detecting my Cross-Origin domain in production?

My website has a separate server for the front-end and back-end, and so my back-end server needs to open up CORS permissions so that the front-end can request data from it. I am using Flask-Cors...

absl.flags._exceptions.UnparsedFlagAccessError: Trying to access flag --tiny before flags were parsed

trying to build a webapp using yolov4,converted the yolov4 weights to tensorflow weights.Using tensorflow==2.3.0rc0 using 2 files helper2.py and app.py Please explain me what changes do i need to...

Python ArcGIS in Flask

Is there a way to use ArcGIS Python API in Flask app, retrieve a WebMap and pass it for display in template HTML? I can see it is quite streight-forward in Jupyter Notebook, but not sure how to ...

Deploy Rasa in Docker

I'm new to Rasa and Docker I want to deploy my rasa project in Docker. I can't find right flow for deployment. what I understood for deployment from blogs and docker videos and tried like...

Python Tkinter with Flask API and Subprocess

Could I run a function from another python file inside subprocess? I use pyinstaller to convert the tkinter to an executable file. As much as possible I would like to deploy/run the .exe file to...

Dockerize Flask: Error: While importing 'app', an ImportError was raised

I am trying to dockerize my Flask API. As soon as I try to start my image I receive the message: * Environment: production WARNING: This is a development server. Do not use it in a production...

blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response

I am trying to create a simple frontend using Typescript and a backend server with Flask and send requests via axios, as I have been using. Somehow I am getting this strange error in the browser...

Add packages from requirements.txt to Docker image to minimize cold start time on EC2?

When deploying a machine learning model on EC2 from a Docker image, the cold start time is high because the instance downloads the packages and files from requirements.txt even though the...

Abnormal memory consumption of process "GeckoMain" when uploading chunks of very large files in Firefox

I am trying to upload very large files (some are +30GB) by chunks. I was using Vue.JS and the dropzone library but noticed that when using Firefox (but not with Chrome) and uploading large files,...