A Django application for analyzing and visualizing energy consumption data across French regions. This project was developed as a technical test demonstrating full-stack development capabilities with Django, Python, and data analysis.
- CSV data import through web interface
- Interactive visualization:
- Regional consumption chart
- Annual consumption chart
- Paginated data table
- Data export API
- Custom data analysis services:
- Peak consumption detection
- Custom data type sorting
- Django
- Tailwind CSS
- Tailwind UI (license)
- Chart.js
- SQLite3 (default)
- Clone the repository:
git clone https://github.com/teosany/energy_dashboard.git
cd energy_dashboard
- Create and activate virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Setup Tailwind CSS:
cd theme/static_src
npm install
cd ../..
python manage.py tailwind start
- Apply migrations:
python manage.py migrate
- Create superuser:
python manage.py createsuperuser
Follow the prompts to create admin user
- Run development server:
python manage.py runserver
Visit:
- Main application: http://localhost:8000
- Admin interface: http://localhost:8000/admin
Export all data in JSON format:
curl http://localhost:8000/api/export/
Response example:
[
{
"date": "2024-01-01",
"region": "Île-de-France",
"consumption": 10.5
}
]
Run tests:
python manage.py test
MIT