Django-Dashboards is an open source Python package developed by Wildfish. The goal of the library is to allow developers to create data-driven dashboards in a "Django-like" way, and produce production ready applications quickly.
Django-Dashboards follows a Django Forms like API to make it familiar to any Django developer and integrates closely with Django's ORM. Developers create various components, such as tables and charts, which are added to a “dashboard” to be presented on screen.
On the frontend Django-Dashboards supports the use of third-party libraries, such as Plotly, to display the data in a visually pleasing way. All layouts and styles are fully customisable in code or by simply changing base templates to give the developer full control over the look and feel.
Over the past few years we have had a number of clients come to us requiring custom dashboards for displaying their large, complex and ever updating datasets. We initially programmed these individually but soon realised that a lot of the requirements overlapped and we’d be better off using a shared library.
In our initial search we found that while there are many tools in the Python ecosystem for building Dashboards - Dash, Streamlit etc. there weren’t any which matched our specific needs.
Since we are a Django consultancy we decided to build one ourselves centred around our favourite framework Django. The goal was to leverage all the advantages Django has to offer while reducing the amount of time and boilerplate code needed to create a dashboard.
We started with 6 key requirements:
We decided to build the initial MVP version of Django-Dashboards in partnership with one of our clients over a 6 month period.
The client was looking to take their telematics data and display it in a variety of charts and tables, allowing their engineers to monitor the data and quickly flag any current or potential issues arising from it. The client came with an expansive dataset and wanted a number of individual dashboards to cover specific areas of the data to be monitored. They had a firm idea on which dashboards were required but not exactly what each component within the dashboard should be. It was decided that this should be something that was built up over the project as and when they identified them.
These ever evolving dashboards not only gave us the platform to build and test the library but also the opportunity to refine our thoughts and ideas on the best approaches to create multiple dashboards within a single web app.
Working closely with the clients engineers also helped identify a number of features which we had not initially considered but were valuable additions to the library.
The final version of the library, which we released as the open source project Django-Dashboards, has the following features out the box:
Django Forms-like API
It follows a Django Forms-like API. This makes the process familiar to those who've used Django before, and simpler for beginners.
Ready-to-use, no need for front-end code
Its built-in templates are fully customisable and enhanced with HTMX, eliminating the need for advanced front-end skills. Django-Dashboards also bundles with a number of additional HTML components to enhance the visuals.
Several built-in component types are available that you can use to build your dashboard:
In-built Permission system
Access permissions can be easily applied, allowing you to restrict dashboard access on an account-by-account basis.
If you are after more granular control there is also the option to restrict individual components within a dashboard. This provides the flexibility to decide what's shown on a dashboard and to whom. This helps create tailored dashboard views for different user roles within an organisation.
Automatic URL routing
Django-Dashboards included its own Django URL routing and custom Django View, making it easy for novice developers to get started quickly.
Advanced layout control
Dashboard layouts can be defined in code within the Dashboard definition itself. This gives developers ultimate control over where each component sits within a dashboard, without needing to touch front-end code.
It’s easy to get started with Django-Dashboard:
Here at Wildfish, we’ve been working away on django-dashboards to support some of our clients. The aim was to build a package for quickly building data-driven dashboards in a “django like” way, closely coupling with the ORM and other key features of Django and minimising the frontend development required to build a new dashboard. The aim of this post is to provide a quick intro to django-dashboards and how to get started.
Django stands out as one of the most powerful and versatile web frameworks available