Initial Release
A quick guide / framework to use Flask and IRIS side by side.
It follows the Official Flask Documentation and the Flask-SQLAlchemy Documentation as close as possible, so that you can easily use them to continue the developing of your application without conflicts.
(Optionally) Create and activate virtual environment. The following code is an example for Windows.
python -m venv .venv
.venv/Scripts/activate
Clone this repository
git clone https://github.com/heloisatambara/flask-iris.git
Make sure you’re in \flask-iris> directory on your terminal and type
pip install -r requirements.txt
Make sure that the instance is running.
engine = create_engine("iris://_SYSTEM:sys@localhost:1972/SAMPLE")
Create your models on flaskr-iris/models.py, according to the Flask-SQLAlchemy or SQLAlchemy Docs.
Edit your templates in flaskr-iris/templates. I followed the Flask Tutorial for this one, so you can check it for more information. Flask uses the Jinja template library.
Run on debug mode.
...\flask-iris> flask --app flaskr-iris run --debug
If you have the default configuration, you will have tables called SQLUser.post and SQLUser.user on the selected namespace, if you wish to perform any treatment with InterSystems’ products. You can find it on Studio on the User folder.
(STILL ON DEVELOPMENT) Also, you can check out step-by-step how this was developed on the Example of Flask application with SQLAlchemy IRIS article.
Feel free to contact me for any doubts!
Add tests