Djangoadmin for flask with restful API。
flask-lab的Python项目详细描述
烧瓶实验室
FlaskLab可以直接从数据库模式创建restful api,而无需任何编码。在
烧瓶实验室是用烧瓶和小瓶子建造的。在
快速入门
安装
pip install flask-lab
或者更好,使用poetry
:
这将安装flask_lab
模块和flask-lab
命令。在
创建演示sqlite数据库(可选)
如果你没有任何数据库可以连接,只想试试烧瓶实验室, 您可以为show case创建一个包含用户和article表的演示数据库:
flask-lab --create-demo
这将使用一些伪数据创建一个flask_lab_demo.db
文件。在
启动flask lab restful服务
flask-lab --engine sqlite --database flask_lab_demo.db
然后在http://localhost:5000/api/user或http://localhost:5000/api/article打开浏览器,您可以看到用户或文章的列表。在
这还将创建flask_lab_models.py
和{
文件
flask-lab -h
Usage: flask_lab.py [options], flask_lab.py -h for detailed help
Options:
-h, --help show this help message and exit
-H HOST, --host=HOST
-p PORT, --port=PORT
-u USER, --user=USER
-P, --password
-e ENGINE, --engine=ENGINE
Database type, e.g. sqlite, mysql, postgresql or
cockroachdb. Default is "postgresql".
-s SCHEMA, --schema=SCHEMA
-t TABLES, --tables=TABLES
Only generate the specified tables. Multiple table
names should be separated by commas.
-v, --views Generate model classes for VIEWs in addition to
tables.
-i, --info Add database information and other metadata to top of
the generated file.
-o, --preserve-order Model definition column ordering matches source table.
-I, --ignore-unknown Ignore fields whose type cannot be determined.
-L, --legacy-naming Use legacy table- and column-name generation.
-m MODEL_FILE, --model-file=MODEL_FILE
Model filename to generate
-a APP_FILE, --app-file=APP_FILE
Flask App filename to generate
-l LISTEN_ADDRESS, --listen-address=LISTEN_ADDRESS
Port for flask app to listen on. Format: 0.0.0.0:5000
-C, --create-demo Create a demo database with Article and User Model to
demo Flask-Lab
-d DATABASE, --database=DATABASE
Database to use
详细文档即将发布。。。在
托多
- 过滤器方法
- 包括和排除
- 日期格式
- 用户、组和权限表,如django admin
- 基于react管理的管理面板,如django admin
- OpenAPI文档
- 项目
标签: