A reusable dashboard boilerplate for Django applications with modern UI and authentication
Project description
Django Dashboard Boilerplate
A reusable dashboard boilerplate for Django applications with a modern UI, responsive design, and dark mode support.
Features
- Modern, responsive UI built with TailwindCSS
- Dark mode support
- Sidebar navigation
- Ready-to-use components
- Easy to customize and extend
Installation
pip install django-dashboard-boilerplate
Quick Start
- Add "dashboard" to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...
'dashboard',
]
- Include the dashboard URLconf in your project urls.py:
urlpatterns = [
...
path('', include('dashboard.urls')),
]
- Configure static and template settings in your settings.py:
import os
# Static files
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
# Templates
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
- Run migrations and start the development server:
python manage.py migrate
python manage.py runserver
Customization
Changing the Theme Colors
The dashboard uses TailwindCSS for styling. You can customize the primary color in your base template:
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: {
// Change these values to your preferred color
50: '#f0f9ff',
100: '#e0f2fe',
200: '#bae6fd',
300: '#7dd3fc',
400: '#38bdf8',
500: '#0ea5e9',
600: '#0284c7',
700: '#0369a1',
800: '#075985',
900: '#0c4a6e',
950: '#082f49',
}
}
}
}
}
</script>
Adding New Pages
- Create a new view in your app's views.py
- Add the URL pattern in your app's urls.py
- Create a template that extends the base template
Example:
# views.py
def my_new_page(request):
return render(request, 'my_new_page.html')
# urls.py
urlpatterns = [
...
path('my-new-page/', my_new_page, name='my_new_page'),
]
<!-- my_new_page.html -->
{% extends 'dashboard/base.html' %}
{% block title %}My New Page{% endblock %}
{% block content %}
<div class="container mx-auto">
<h1 class="text-2xl font-bold text-gray-800 dark:text-white">My New Page</h1>
<!-- Your content here -->
</div>
{% endblock %}
Customizing the Sidebar
To customize the sidebar, create a template override in your project:
- Create a file at
templates/dashboard/components/sidebar.htmlin your project - Copy the content from the original sidebar template and modify as needed
Development
Setup Development Environment
- Clone the repository:
git clone https://github.com/yourusername/django-dashboard-boilerplate.git
cd django-dashboard-boilerplate
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
Example Project
Check out the example directory for a complete example of how to use this package in a Django project.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_dashboard_boilerplate-0.1.0.tar.gz.
File metadata
- Download URL: django_dashboard_boilerplate-0.1.0.tar.gz
- Upload date:
- Size: 44.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5de491faf7b0123856a0a75ba426a886a18096c2787798730b8c22166380a46
|
|
| MD5 |
408c9f4fb962b1374c3665f3e5266719
|
|
| BLAKE2b-256 |
95581861a8379c44b45e710dc98d949f040c8538d4c97788d6258d3af1bacb86
|
File details
Details for the file django_dashboard_boilerplate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_dashboard_boilerplate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 55.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7ff2f7922fb14ab08758d7234a977eeff1db331a3cb58d29c2308dc1422b5c3
|
|
| MD5 |
719eb9fddfcfd48c2f21b672d3807763
|
|
| BLAKE2b-256 |
ef631889961016f37f62f616a690b281375b0d682fec4832deab0faec4421843
|