Codementor Events

AdminLTE Flask - Open-source dashboard

Published Jul 17, 2020Last updated Oct 14, 2021
AdminLTE Flask - Open-source dashboard

Hello coders,
This article presents AdminLTE Flask, an open-source admin dashboard template coded in Flask. For newcomers, AdminLTE is a well-known design actively supported by 150+ contributors and 35k Github stars. For newcomers, Flask is a lightweight web application framework written in Python. Sometimes classified as a microframework, Flask provides a lightweight codebase that can be easily extended to become an API, a simple web app, or a complex eCommerce platform. This Flask codebase is provided with basic modules, database, authentication and the permissive (MIT) license allows unlimited hobby and commercial projects.


Links


AdminLTE Flask - Open-source admin dashboard provided in Flask by AppSeed.


This simple starter can be used by beginners to add simple features and new pages on top of existing codebase provided with a short-list with features:

  • Authentication, Database, Blueprints
  • ORM, Alembic for migrations
  • Deployment scripts: Heroku, Docker

In case you have issues, don't hesitate to ask me anything in the comments or chat with me on Discord.


What is Flask

Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. Classified as a microframework, Flask is written in Python and it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.

Related Flask resources


Development Environment

To use the stater, Python3 should be installed properly in the workstation. If you are not sure if Python is properly installed, please open a terminal and type python --version. The full-list with dependencies and tools required to build the app:

  • Python3 - the programming language used to code the app
  • GIT - used to clone the source code from the Github repository
  • Basic development tools (g++ compiler, python development libraries ..etc) used by Python to compile the app dependencies in your environment.

How to check Python version (using the terminal)

$ # Check Python version
$ python --version
Python 3.7.2 # <--- All good

How to check GIT command tool (using the terminal)

$ # Check git
$ git --version
$ git version 2.10.1.windows.1 # <--- All good

For more information regarding the environment set up, feel free to access these short-list with tutorials:


AdminLTE Codebase Structure

Starter uses a simple codebase (no Blueprints) with a structure presented bellow:

< PROJECT ROOT >
   |
   |-- app/                    # Implements app logic
   |    |-- base/              # Base Blueprint - handles the authentication
   |    |-- home/              # Home Blueprint - serve UI Kit pages
   |    |
   |   __init__.py             # Initialize the app
   |
   |-- requirements.txt        # Development modules - SQLite storage
   |-- requirements-mysql.txt  # Production modules  - Mysql DMBS
   |-- requirements-pqsql.txt  # Production modules  - PostgreSql DMBS
   |
   |-- .env                    # Inject Configuration via Environment
   |-- config.py               # Set up the app
   |-- run.py                  # Start the app - WSGI gateway
   |
   |-- ************************

How to build AdminLTE Flask

To built and start the app locally, follow the steps:

Get the source code

Change the current directory to source code directory.

Clone/download the sources

$ # Get the code
$ git clone https://github.com/app-generator/flask-dashboard-adminlte.git
$ cd flask-dashboard-adminlte

Set up the environment

$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows based systems)
$ # virtualenv env
$ # .\env\Scripts\activate

Install modules

$ # Install modules - SQLite Database
$ pip3 install -r requirements.txt

Start the Flask application

$ # Set the FLASK_APP environment variable
$ export FLASK_APP=run.py
$
$ # Start the application (development mode)
$ flask run
$
$ # Access the dashboard in browser: http://127.0.0.1:5000/

At this point, we should be able to access the dashboard in the browser. To unlock the private pages, let's create a new user via the registration page and authenticate.

AdminLTE Flask - Main dashboard page

AdminLTE Flask - Free admin panel coded in Flask.


AdminLTE Flask - Calendar page

AdminLTE Flask - Free admin panel coded in Flask.


AdminLTE Flask - Charts Page

AdminLTE Flask - Free admin panel coded in Flask.


Thanks for reading! Feel free to ask me anything in the comments:

Discover and read more posts from Adi Chirilov - Sm0ke
get started
post commentsBe the first to share your opinion
Martinez Assa
8 months ago

AdminLTE Flask is a powerful combination of technologies that brings together the versatile AdminLTE dashboard template and the Flask web framework. AdminLTE, known for its sleek and responsive design, offers a dynamic user interface for web applications. When integrated with Flask, a Python micro web framework, it allows developers to create feature-rich and visually appealing web applications efficiently. An exemplary illustration of this synergy can be found in https://www.lawofficespace.com/ demonstrating how AdminLTE Flask can be harnessed to craft engaging and functional legal office space management solutions while showcasing the seamless integration of design and functionality.

Casa Davis
9 months ago

An open-source dashboard is an invaluable tool that provides users with a centralized platform to monitor and analyze data from various sources. It offers a user-friendly interface, allowing individuals or organizations to visualize key metrics, track progress, and make informed decisions. With its customizable nature, users can tailor the dashboard to their specific needs, incorporating widgets, charts, and graphs. Furthermore, an open-source dashboard provides the advantage of transparency and flexibility, enabling users to modify the codebase to suit their requirements. Whether it’s for business analytics, project management, or personal data tracking, an open-source dashboard is a valuable resource that allows users to effortlessly check https://magicalkatrina.com/magiciansblog/2qxk6vqocuefhdvzbxo9th6gvct6tdand gain insights from their data.

Rb Ra
4 years ago

Thank you Adi for this great work! Can I know the different of this Flask version with the Jinja2 version? If I want build a quick POC with Flask, which version I need to use? Many thanks!

Adi Chirilov - Sm0ke
3 years ago

Hello!
Sorry for this super late reply. Somehow, I didn’t see this notification.

Jinja is more suitable for a POC. In case your project requires a database and authentication, using the Flask version might be a better choice.

Best Regards.

Show more replies