I'm familiar with Flask for building simple webapps and using jinja2 as a template engine. However, I'd like to try out React.js as a front-end.
The examples I've seen that use React.js with a Python backend essentially use it as an API server to call the json needed to include in the React views. However, how does this work with authentication models and libraries for Flask? Can you mix-and-match jinja2 and React.js within the same template, to get access to the session data?
Any pointers or experience to help get started would be appreciated.
It is possible to use React.js within the Jinja2 template system. This is the solution, placing the React components within an authorised user if loop, using a library like Flask-Login.
Here's a further example I found of someone working this through: Flask and Reactjs throw JSX Transform error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With