A beautiful Django-based GitHub statistics dashboard with multiple theme support and embeddable badges.
- 📊 Comprehensive GitHub statistics dashboard
- 🎨 Multiple beautiful themes (Neon Dark, Solar Dark, Light Clean, Minimal Dark)
- 📈 Interactive charts for contributions and activity
- 🏆 Contribution streaks tracking
- 💻 Language usage statistics
- 🖼️ Embeddable SVG badges for GitHub README
- ⚡ Caching for optimal performance
- 📱 Responsive design
The dashboard displays:
- User profile information
- Total contributions and activity
- Monthly and daily contribution charts
- Most used programming languages
- Current and longest contribution streaks
- GitHub stats (stars, commits, PRs, issues)
- Python 3.8+
- Node.js and npm (for Tailwind CSS)
- Git
- Clone the repository:
git clone <repository-url>
cd github-stat-generator- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install Python dependencies:
pip install -r requirements.txt- Install Tailwind CSS:
npm install- Build Tailwind CSS:
npm run build-cssFor development with auto-rebuild:
npm run watch-css- Create a
.envfile (REQUIRED to avoid rate limits):
touch .envEdit .env and add your GitHub token (REQUIRED):
# Generate a secret key
python manage.py shell -c "from django.core.management.utils import get_random_secret_key; print('SECRET_KEY=' + get_random_secret_key())"Add to .env:
GITHUB_TOKEN=your_github_token_here
SECRET_KEY=your-secret-key-here
DEBUG=True
Important: Get a GitHub token to avoid rate limits:
- Go to https://github.com/settings/tokens
- Click "Generate new token" → "Generate new token (classic)"
- Give it a name (e.g., "GitHub Stats Generator")
- Select expiration (or "No expiration" for development)
- No permissions needed - public read-only access is enough
- Click "Generate token" and copy it
- Paste it in your
.envfile asGITHUB_TOKEN=your_token_here
Without a token: 60 requests/hour per IP
With a token: 5,000 requests/hour
- Run migrations:
python manage.py migrate- Collect static files:
python manage.py collectstatic --noinput- Start the development server:
python manage.py runserver- Open your browser and navigate to
http://127.0.0.1:8000
- Go to the home page
- Enter a GitHub username
- Click "View Stats" to see the dashboard
Or directly visit: http://127.0.0.1:8000/u/<username>/
- Use the theme dropdown in the navigation bar
- Themes are saved in a cookie and persist across sessions
- You can also use query parameters:
?theme=neon_dark
Available themes:
neon_dark- Neon blue accents on dark backgroundsolar_dark- Warm orange/yellow accentslight_clean- Clean light thememinimal_dark- Minimal dark theme
Add this to your GitHub README:
Replace:
your-domain.comwith your domainUSERNAMEwith the GitHub usernamethemewith your preferred theme (optional)
Example:
GITHUB_TOKEN- GitHub API token (optional, increases rate limit)SECRET_KEY- Django secret key (required for production)DEBUG- Debug mode (set toFalsein production)
Stats are cached for 30 minutes by default. You can change this in github_stats/settings.py:
GITHUB_CACHE_TIMEOUT = 1800 # seconds
github-stat-generator/
├── dashboard/ # Main Django app
│ ├── services/ # GitHub API client
│ ├── templates/ # HTML templates
│ ├── themes.py # Theme definitions
│ ├── views.py # View handlers
│ └── urls.py # URL routing
├── github_stats/ # Django project settings
├── static/ # Static files (CSS, JS)
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── package.json # Node.js dependencies
└── tailwind.config.js # Tailwind CSS configuration
Without a GitHub token:
- 60 requests per hour per IP
With a GitHub token:
- 5,000 requests per hour
The app uses caching to minimize API calls. Stats are cached for 30 minutes.
python manage.py testnpm run build-cssnpm run watch-css- Add a GitHub token to your
.envfile - Wait for the cache to expire (30 minutes)
- Clear the cache:
python manage.py shell→from django.core.cache import cache; cache.clear()
- Verify the username is correct
- Check if the user exists on GitHub
- Ensure the user has public repositories
- Run
npm run build-cssto build Tailwind CSS - Check that
static/css/output.cssexists - Run
python manage.py collectstatic
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with Django
- Styled with Tailwind CSS
- Charts powered by Chart.js
- Data from GitHub API