Added Flask-Demo and Flask AppBuilder tutorial
This commit is contained in:
30
fab/README.md
Normal file
30
fab/README.md
Normal 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
|
||||
```
|
||||
Reference in New Issue
Block a user