Skip to main content

Simple and extensible admin interface framework for Flask

Project description

Flask-Admin

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

image image

Pallets Community Ecosystem

[!IMPORTANT]
This project is part of the Pallets Community Ecosystem. Pallets is the open source organization that maintains Flask; Pallets-Eco enables community maintenance of related projects. If you are interested in helping maintain this project, please reach out on the Pallets Discord server.

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 over the look, feel, functionality and user experience of the resulting application.

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

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

The biggest feature of Flask-Admin is its flexibility. It aims to provide a set of simple tools that can be used to build admin interfaces of any complexity. To start off, you can create a very simple application in no time, with auto-generated CRUD-views for each of your models. Then you can further customize those views and 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/pallets-eco/flask-admin.git
    cd flask-admin
    
  2. Create and activate a virtual environment:

    # Windows:
    python -m venv .venv
    .venv\Scripts\activate
    
    # Linux:
    python3 -m venv .venv
    source .venv/bin/activate
    
  3. Navigate into the SQLAlchemy example folder:

    cd examples/sqla
    
  4. Install requirements:

    pip install -r requirements.txt
    
  5. Run the application:

    python app.py
    
  6. Check the Flask app running on http://localhost:5000.

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. If you come across any errors or if you think of anything else that should be included, feel free to make the changes and submit a pull-request.

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

tox -e docs-html

Installation

To install Flask-Admin, simply:

pip install flask-admin

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

git clone https://github.com/pallets-eco/flask-admin.git
cd flask-admin
pip install .

Tests

Tests are run with pytest. If you are not familiar with this package, you can find out more on their website.

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

pip install --use-pep517 -r requirements/dev.txt
pytest

You should see output similar to:

.............................................
----------------------------------------------------------------------
Ran 102 tests in 13.132s

OK

NOTE! For all the tests to pass successfully, you'll need Postgres (with the postgis and hstore extension) & MongoDB to be running locally. You'll also need libgeos available.

For Postgres:

psql postgres
> CREATE DATABASE flask_admin_test;
> # Connect to database "flask_admin_test":
> \c flask_admin_test;
> CREATE EXTENSION postgis;
> CREATE EXTENSION hstore;

If you're using Homebrew on MacOS, you might need this:

# Install postgis and geos
brew install postgis
brew install geos

# Set up a PostgreSQL user
createuser -s postgresql
brew services restart postgresql

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-Babel package.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_admin-2.0.0a3.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

flask_admin-2.0.0a3-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

Details for the file flask_admin-2.0.0a3.tar.gz.

File metadata

  • Download URL: flask_admin-2.0.0a3.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flask_admin-2.0.0a3.tar.gz
Algorithm Hash digest
SHA256 cf09bab5b732dbdb0ea9a245ee34bbd941a932f096b619d6f982ff5faa3f47eb
MD5 75db424fd633bf2686a084d7b38a7713
BLAKE2b-256 b9cb062d75123510a3e60eab076264fdb68e50724ea5cee62d71c10d171d79dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_admin-2.0.0a3.tar.gz:

Publisher: publish.yaml on pallets-eco/flask-admin

Attestations:

File details

Details for the file flask_admin-2.0.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_admin-2.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 f229f8e9a4b7eb1bcd57386d23c44442c73ffa121e5a20e89a03b83f68b303dd
MD5 f997e8e12de3857956df303d4ee101f9
BLAKE2b-256 c9b80e24bcd0c6b4d4b9effc12dabe11b8d61f44372eff34f1d0501a12feee93

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_admin-2.0.0a3-py3-none-any.whl:

Publisher: publish.yaml on pallets-eco/flask-admin

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page