Sample project crafted with Django, Chart.JS, and DRF to showcase how to plot different charts Pie, Line and Bar Charts. Frontend uses Bootstrap5 for styling and Chart.js for dynamic charts. The dataset is loaded from data directory.
- 👉 Charts via DRF - Related blog article
- 👉 More Django apps and dashboards
Features:
- ✅
Up-to-date dependencies - ✅
Stack: Django - ✅
APIvia DRF - ✅
Charts: Chart.js - ✅
Styling: BS5 (via CDN)
👉 Clone Sources (this repo)
$ git clone https://github.com/app-generator/sample-django-charts-js.git
$ cd sample-django-charts-js👉 Install Modules using a Virtual Environment
$ virtualenv env
$ source env/bin/activate
$ pip3 install -r requirements.txtOr for Windows-based Systems
$ virtualenv env
$ .\env\Scripts\activate
$
$ # Install modules - SQLite Database
$ pip3 install -r requirements.txt👉 Migrate Database
$ python manage.py migrate
$ python manage.py runserver👉 Create Superuser
$ python manage.py createsuperuser👉 Start the APP
$ python manage.py runserverThe bootstrap flow
- Access the
adminsection- Load
data/users.csvin users table (using import/export feature) - Load
data/products.csvin users table (using import/export feature)
- Load
- Access the HOMEpage
- Charts should be displayed with data
Django Charts via DRF - provided by AppSeed
