-
Notifications
You must be signed in to change notification settings - Fork 8
Flask App Builder Integration
valhuber edited this page Sep 11, 2021
·
7 revisions
Flask AppBuilder is based on SQLAlchemy, so is naturally integrated with Logic Bank. There are 2 approaches:
-
ApiLogicServer creates an executable, customizable project from your database. It is the most straight-forward approach for use Flask AppBuilder. Please examine it for a working example.
-
You can also integrate Logic Bank into your existing Flask AppBuilder application. The sections below outline some of the key considerations.
Alter your examples/nw/basic_web_app/app/__init__.py
:
appbuilder = AppBuilder(app, db.session)
if use_rules: # insert this....
LogicBank.activate(session=db.session, activator=declare_logic)
The code above requires several imports. Depending on your project structure, you may need to update Python's search path. This was, in fact, required here, with code like:
sys.path.append(required_path_python_rules)
Finally, configure logging:
Configure Logging
Developed with PyCharm
User Project Operations
Logic Bank Internals