Forums

Cannot hit my web app from Shopify

Hello: I am having trouble trying to call my Flask web app from my Shopify site. I keep getting this message:

tree-of-life-metal-sign:1 Access to XMLHttpRequest at 'https://dmyers929.pythonanywhere.com/fetchPreview/' from origin 'https://peacefulbluenew.myshopify.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Here is my python app code setting up CORS. I believe this is the default which should allow everything. Does anyone know how to fix this? Thanks, David

from flask import Flask, render_template, jsonify, request
from flask_cors import CORS, cross_origin

app = Flask(__name__)
app.config['CORS_HEADERS'] = 'Content-Type'
CORS(app)

[formatted by admin]

If I read the message correctly it's failing not due to the CORS not working, but because https://dmyers929.pythonanywhere.com/fetchPreview/ is not returning response with 2XX code (it's actually 404 right now).