No reason not to do these earlier.
DRY
Move GUID into models.
Flask cruft
And move around where create_app is.
Allow passing in a config, and make the db a global since it uses a pool anyhow.