reactpy with flask #1141
-
Hello beautiful community. I have a question regarding reactpy with flask framework. I normally use flask to deploy ml apps. Is it possible to still be able to define my routes using flask and have it do server side data processing before sending information to reactpy in the frontend? |
Beta Was this translation helpful? Give feedback.
Answered by
Archmonger
Sep 21, 2023
Replies: 1 comment
-
Yes, you can do this by embedding ReactPy into your Flask HTML templates using our script <script type="module">
import { mount } from "https://esm.sh/@reactpy/client";
const client = new SimpleReactPyClient({
serverLocation: {
url: document.location.origin,
route: document.location.pathname,
query: document.location.search,
},
});
mount(element, client);
</script> Please note that embedding ReactPy is currently easier to do with the Django backend, by using our template tag. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Archmonger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you can do this by embedding ReactPy into your Flask HTML templates using our script
Please note that embedding ReactPy is currently easier to do with the Django backend, by using our template tag.