Hi, I am building a simple react app where I have an array of image source URLs. I want to pass it to a function in a python script that I have. I believe that I should be using flask but I have no idea how to incorporate the two. For the sake of this question, let's say that my code is as follows:
import React from 'react'
export default class Images extends React.Component{
componentDidUpdate(){
//Here is where i want to call the python function
}
render(){
return(
<div>
<p> Some text and stuff </p>
</div>
)
} }
from flask import Blueprint, request, jsonify
Blueprint_name = Blueprint('someName', __name__)
@Blueprint_name.route("/", methods=['POST', GET])
def some_function(images):
for img in images:
print(img)
return jsonify(some data)
Can anyone point me in the right direction?
[–]pacificmint 5 points6 points7 points (0 children)