An interactive web application that teaches Django through hands-on modules. Explore beginner to advanced topics with live demos, a sandboxed code executor, progress tracking, and a gamified achievement system.
- Interactive Learning Modules — Beginner, intermediate, and advanced topics with live demos and code examples
- Sandboxed Code Execution — Run Python code safely in the browser with process isolation, timeouts, and resource limits
- Progress Tracking — Track module completion, view activity timelines, and monitor your learning journey
- Achievements & Leaderboard — Earn badges, climb the leaderboard, and stay motivated through gamification
- REST API — Full API with Swagger and ReDoc documentation powered by Django REST Framework
- Responsive Dark UI — Tailwind CSS dark theme with Alpine.js interactivity and Highlight.js code highlighting
| Layer | Technology |
|---|---|
| Backend | Django 5.0+, Django REST Framework, drf-spectacular |
| Database | PostgreSQL 16 |
| Caching | Redis 7 |
| Task Queue | Celery |
| Frontend | Tailwind CSS (CDN), Alpine.js, Highlight.js |
| Production | Gunicorn, Nginx, Docker, WhiteNoise |
- Python 3.12+
- PostgreSQL 16+ (or use Docker)
- Redis 7+ (or use Docker)
- Docker & Docker Compose (for containerized deployment)
-
Clone the repository
git clone <repository-url> cd django-learning-dashboard
-
Create a virtual environment
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
cp .env.example .env
Edit
.envand set your values. For local development with SQLite fallback, the defaults work out of the box. For PostgreSQL, update theDB_*variables. -
Run migrations
python manage.py migrate
-
Seed learning modules and badges
python manage.py seed_beginner_modules python manage.py seed_intermediate_modules python manage.py seed_advanced_modules python manage.py seed_badges python manage.py recalculate_leaderboard
-
Create a superuser (optional)
python manage.py createsuperuser
-
Start the development server
python manage.py runserver
Visit http://localhost:8000 to see the dashboard.
-
Configure environment
cp .env.example .env # Edit .env with production values (SECRET_KEY, DB credentials, etc.) -
Build and start all services
docker-compose up -d --build
-
Run migrations and seed data
docker-compose exec web python manage.py migrate docker-compose exec web python manage.py seed_beginner_modules docker-compose exec web python manage.py seed_intermediate_modules docker-compose exec web python manage.py seed_advanced_modules docker-compose exec web python manage.py seed_badges docker-compose exec web python manage.py recalculate_leaderboard
-
Create a superuser
docker-compose exec web python manage.py createsuperuser
The application will be available at http://localhost (port 80 via Nginx).
| Service | Image | Purpose |
|---|---|---|
web |
Custom (Dockerfile) | Django app served by Gunicorn |
db |
postgres:16-alpine | PostgreSQL database |
redis |
redis:7-alpine | Caching and Celery broker |
celery_worker |
Custom (Dockerfile) | Async task processing |
nginx |
nginx:1.25-alpine | Reverse proxy and static files |
| Variable | Description | Default |
|---|---|---|
DJANGO_SETTINGS_MODULE |
Settings module path | config.settings.development |
SECRET_KEY |
Django secret key | Dev key (change in production) |
DEBUG |
Enable debug mode | True |
ALLOWED_HOSTS |
Comma-separated allowed hosts | localhost,127.0.0.1 |
DB_NAME |
PostgreSQL database name | django_dashboard |
DB_USER |
PostgreSQL user | postgres |
DB_PASSWORD |
PostgreSQL password | postgres |
DB_HOST |
Database host | db |
DB_PORT |
Database port | 5432 |
REDIS_URL |
Redis connection URL | redis://redis:6379/1 |
CELERY_BROKER_URL |
Celery broker URL | redis://redis:6379/0 |
NGINX_PORT |
Nginx exposed port | 80 |
├── config/ # Project configuration
│ ├── settings/
│ │ ├── base.py # Shared settings
│ │ ├── development.py # Dev overrides
│ │ └── production.py # Production settings
│ ├── celery.py # Celery configuration
│ ├── urls.py # Root URL routing
│ └── wsgi.py / asgi.py
├── apps/
│ ├── core/ # Dashboard home, Module/Category models
│ ├── modules/ # Learning module views and demos
│ │ └── demos/ # Beginner, intermediate, advanced demos
│ ├── progress/ # Progress tracking and activity logging
│ ├── code_executor/ # Sandboxed Python code execution
│ ├── achievements/ # Badges, leaderboard, gamification
│ └── api/ # REST API viewsets and serializers
├── templates/ # Global templates and components
├── static/ # Static assets (CSS, JS, images)
├── docker-compose.yml
├── Dockerfile
├── nginx/ # Nginx configuration
├── requirements.txt
└── manage.py
# Seed learning modules by difficulty level
python manage.py seed_beginner_modules
python manage.py seed_intermediate_modules
python manage.py seed_advanced_modules
# Seed achievement badges
python manage.py seed_badges
# Recalculate leaderboard rankings
python manage.py recalculate_leaderboardThe REST API is available at /api/v1/ with interactive documentation:
| URL | Description |
|---|---|
/api/docs/ |
Swagger UI — interactive API explorer |
/api/redoc/ |
ReDoc — clean API reference |
/api/schema/ |
OpenAPI 3.0 schema (JSON) |
/api/ |
Built-in API explorer page |
# Run all tests
python manage.py test
# Run tests for a specific app
python manage.py test apps.core
python manage.py test apps.modules
python manage.py test apps.progress
python manage.py test apps.code_executor
python manage.py test apps.achievements
python manage.py test apps.api
# Run with verbosity
python manage.py test -v 2- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes and add tests
- Run the test suite to confirm everything passes
- Commit your changes (
git commit -m 'Add your feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
This project is provided for educational purposes. See LICENSE for details.