No need to add manage.py file, directly use flask db init
for the 1st time. Then use flask db migrate -m "message"
to generate migration scripts and flask db upgrade
to migrate.
Please use pip install flask==1.1.4
instead of directly install which is Flask 2.x.x.
db is seperated to db.py file and used in this whole project. In this way the migration can only work fine.
Use flasgger for Swagger UI, but don't use this for API doc generation. Please directly use Postman.
Related to PYTHONPATH. refer to https://blog.csdn.net/NeverLate_gogogo/article/details/107615838
myapi/
__init__.py
app.py # this file contains your app and routes
resources/
__init__.py
foo.py # contains logic for /Foo
bar.py # contains logic for /Bar
common/
__init__.py
util.py # just some common infrastructure
models.py # contains models for ORM
settings.py # map secret configuration from .env
.env contains secret