Flask简单的和可扩展的管理界面框架

网友投稿 824 2022-10-28

Flask简单的和可扩展的管理界面框架

Flask简单的和可扩展的管理界面框架

Flask-Admin

The project was recently moved into its own organization. Please update your references to git@github.com:flask-admin/flask-admin.git.

Introduction

Flask-Admin is a batteries-included, simple-to-use Flask extension that lets you add admin interfaces to Flask applications. It is inspired by the django-admin package, but implemented in such a way that the developer has total control of the look, feel and functionality of the resulting application.

Out-of-the-box, Flask-Admin plays nicely with various ORM's, including

SQLAlchemy,MongoEngine,pymongo andPeewee.

It also boasts a simple file management interface and a redis client console.

The biggest feature of Flask-Admin is flexibility. It aims to provide a set of simple tools that can be used for building admin interfaces of any complexity. So, to start off with you can create a very simple application in no time, with auto-generated CRUD-views for each of your models. But then you can go further and customize those views & forms as the need arises.

Flask-Admin is an active project, well-tested and production ready.

Examples

Several usage examples are included in the /examples folder. Please add your own, or improve on the existing examples, and submit a pull-request.

To run the examples in your local environment:

1. Clone the repository:: git clone https://github.com/flask-admin/flask-admin.git cd flask-admin2. Create and activate a virtual environment:: virtualenv env -p python3 source env/bin/activate3. Install requirements:: pip install -r examples/sqla/requirements.txt4. Run the application:: python examples/sqla/run_server.py

Documentation

Flask-Admin is extensively documented, you can find all of the documentation at https://flask-admin.readthedocs.io/en/latest/.

The docs are auto-generated from the .rst files in the /doc folder. So if you come across any errors, or if you think of anything else that should be included, then please make the changes and submit them as a pull-request.

To build the docs in your local environment, from the project directory:

tox -e docs-html

And if you want to preview any .rst snippets that you may want to contribute, go to http://rst.ninjs.org/.

Installation

To install Flask-Admin, simply:

pip install flask-admin

Or alternatively, you can download the repository and install manually by doing:

git clone git@github.com:flask-admin/flask-admin.gitcd flask-adminpython setup.py install

Tests

Test are run with nose. If you are not familiar with this package you can get some more info from their website.

To run the tests, from the project directory, simply:

pip install -r requirements-dev.txtnosetests

You should see output similar to:

.............................................----------------------------------------------------------------------Ran 102 tests in 13.132sOK

For all the tests to pass successfully, you'll need Postgres & MongoDB to be running locally. For Postgres:

> psql postgresCREATE DATABASE flask_admin_test;\q> psql flask_admin_testCREATE EXTENSION postgis;CREATE EXTENSION hstore;

You can also run the tests on multiple environments using tox.

3rd Party Stuff

Flask-Admin is built with the help of Bootstrap, Select2 and Bootswatch.

If you want to localize your application, install the Flask-BabelEx package.

You can help improve Flask-Admin's translations through Crowdin: https://crowdin.com/project/flask-admin

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:注解的那些事儿(三)| 注解的使用
下一篇:php显示指定长度的字符串,超出长度以省略号填补尾部
相关文章

 发表评论

暂时没有评论,来抢沙发吧~