Added Flask-Demo and Flask AppBuilder tutorial

This commit is contained in:
2025-10-31 22:19:57 -04:00
parent 897ee0714f
commit 895dbbb811
9 changed files with 547 additions and 0 deletions

30
fab/README.md Normal file
View File

@@ -0,0 +1,30 @@
# webapp
This application is built using [Flask-AppBuilder](https://github.com/dpgaspar/Flask-AppBuilder) version 5.
## Files
* [app.py](app.py) -- Initialize the Flask application, database session, and appbuilder object.
* [config.py](config.py) -- Configure application settings such as the database URI, secret key, etc.
* [models.py](models.py) -- SQLAlchemy model classes (database tables) generated by `sqlacodegen`.
* [views.py](views.py) -- Flask-AppBuilder views that provide CRUD web interfaces for the models.
## Setup
Generate a random SECRET_KEY for use in config.py:
``` sh
python -c 'import secrets; print(secrets.token_hex())'
```
Create an admin user before running for the first time:
``` sh
flask fab create-admin
```
## Running
Start a local dev server with debugging and reloading:
``` sh
flask run --debug
```