From cb37c04f33389157158cd8df5d2fc5e9e4ed4c40 Mon Sep 17 00:00:00 2001 From: paulmwatson Date: Mon, 30 Sep 2024 09:44:05 +0200 Subject: [PATCH] Added Flask-CORS which defaults to allowing all origins --- pmg/__init__.py | 2 ++ requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/pmg/__init__.py b/pmg/__init__.py index a4b5a1e1..f64bf61c 100644 --- a/pmg/__init__.py +++ b/pmg/__init__.py @@ -3,6 +3,7 @@ import os from flask import Flask +from flask_cors import CORS from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_caching import Cache @@ -26,6 +27,7 @@ integrations=[FlaskIntegration()]) app = Flask(__name__, static_folder="static") +CORS(app) app.config.from_pyfile("../config/config.py") # setup logging diff --git a/requirements.txt b/requirements.txt index 96d62e7a..09ea8545 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,7 @@ Flask==2.0.0 Flask-Admin==1.6.1 Flask-Assets==0.10 Flask-Caching==2.0.2 +Flask-Cors==5.0.0 Flask-Login==0.3.0 Flask-Mail==0.9.1 flask-marshmallow==0.7.0