djboost 🚀
A CLI-based Django project generator for quickly scaffolding production-oriented backend projects.
djboost helps developers quickly scaffold production-oriented backend projects with APIs, authentication, background tasks, documentation, Docker, testing, security defaults, and CI/CD. Instead of repeatedly configuring the same backend infrastructure from scratch, djboost provides a consistent foundation that developers can customize for their projects.
pip install djboost
djboost create project myproject
That's it. Your project is ready.
✨ What you get
| Feature | Details |
|---|---|
| REST API | Django REST Framework + Simple JWT pre-configured |
| API Docs | Swagger UI + ReDoc at /api/schema/swagger-ui/ |
| Async Tasks | Celery + Redis (add only when needed) |
| WebSockets | Django Channels + Daphne ASGI server |
| Database | PostgreSQL config ready (SQLite default for dev) |
| Environment | python-decouple with fully pre-filled .env |
| Docker | Dockerfile + docker-compose.yml with 6 services |
| Security | CORS, CSRF, XSS headers, throttling all configured |
| Static Files | Whitenoise for efficient static file serving |
| Code Quality | pre-commit with black, flake8, isort |
| Testing | pytest + pytest-django with coverage |
| CI/CD | GitHub Actions and GitLab CI pipelines |
| Exception Handler | Global DRF handler → {"success": false, "message": "..."} |
| Response Format | Standard success/error/pagination format |
| Pagination | Custom pagination with meta info |
| Modular CLI | Add/remove features anytime with djboost add |
🚀 Quick Start
1 — Create a virtual environment
python -m venv env
# Windows
env\Scripts\activate
# Mac / Linux
source env/bin/activate
2 — Install djboost
pip install djboost
3 — Create your project
Navigate to an empty folder and run:
djboost create project myproject
This single command will:
- Install Django and scaffold the project
- Configure
settings.pywith production-ready settings - Generate
.envpre-filled with all required keys - Set up
pytest.ini,.pre-commit-config.yaml,.gitignore - Install only 13 essential dependencies (add more later as needed)
- Create
common/package with response helpers, pagination, and exception handler - Freeze
requirements.txt
📱 Creating Apps
cd myproject
djboost create app users
This creates a standard app structure:
apps/users/
├── views/ ← Multiple view files (not single file)
│ ├── __init__.py
│ └── users.py ← List + Detail views
├── serializers/ ← Multiple serializer files
│ ├── __init__.py
│ └── users.py ← Detail + List serializers
├── service/ ← Business logic layer
│ ├── __init__.py
│ └── helpers.py ← Helper functions
├── permissions.py ← Custom permissions (IsOwner, IsAdminOrReadOnly)
├── tasks.py ← Celery tasks template
├── models.py ← Standard model with UUID, user, timestamps
├── admin.py ← Admin config with list_display, filters
├── urls.py ← Standard URL patterns
├── apps.py ← App config (name = 'apps.users')
└── tests.py ← Fresh default Django test file
🔐 Creating Accounts App (Full Auth System)
Create a complete accounts app with all auth APIs ready:
djboost create accounts
This creates a production-ready accounts module:
apps/accounts/
├── models.py ← Custom User (email login), EmailOTP, AdminSectionPermission
├── permissions.py ← IsSuperAdmin, IsAdmin, HasSectionAccess, IsOwner
├── tasks.py ← Celery tasks for OTP emails, admin invitations
├── views/
│ ├── auth.py ← SignUp, SignIn, VerifyEmail, SocialLogin, RefreshToken
│ ├── password.py ← ForgotPassword, ResetPassword, ChangePassword
│ └── profile.py ← MyAccount (GET/PUT)
├── serializers/
│ ├── auth.py ← SignUp, SignIn, VerifyEmail, SocialLogin
│ ├── password.py ← ForgotPassword, ResetPassword, ChangePassword
│ └── profile.py ← UserProfile
├── urls.py ← All auth endpoints
├── admin.py ← User admin with role management
├── apps.py
├── tests.py
└── migrations/
API Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/sign-up |
Register new user |
| POST | /api/auth/verify-email |
Verify email with OTP |
| POST | /api/auth/resend-code |
Resend verification code |
| POST | /api/auth/sign-in |
Login with email/password |
| POST | /api/auth/forgot-password |
Request password reset |
| POST | /api/auth/verify-reset-code |
Verify reset code |
| POST | /api/auth/reset-password |
Reset password |
| POST | /api/auth/refresh-token |
Refresh JWT token |
| POST | /api/auth/social-login |
Social login (Google/Facebook/Apple) |
| POST | /api/auth/change-password |
Change password (authenticated) |
| GET | /api/auth/my-account |
Get profile (authenticated) |
| PUT | /api/auth/my-account |
Update profile (authenticated) |
📋 CI/CD Pipelines
Add or remove CI/CD any time — it's modular.
djboost add cicd github # GitHub Actions
djboost add cicd gitlab # GitLab CI
djboost remove cicd github
djboost remove cicd gitlab
⚡ Adding Celery
Add Celery to your existing Django project:
djboost add celery # Add Celery worker
djboost add celery-beat # Add Celery Beat scheduler
This will:
- Install
celery+redispackages - Generate
celery.pyandtasks.pyin your project - Update
settings.pywith Celery configuration - Update
requirements.txt
Removing Celery
djboost remove celery
This will:
- Uninstall
celery+redispackages - Remove
celery.pyandtasks.pyfiles - Remove Celery configuration from
settings.py - Remove Celery from
requirements.txt
🐳 Adding Docker
Add Docker configuration to your existing Django project:
djboost add docker
This will:
- Generate
Dockerfile - Generate
docker-compose.ymlwith 6 services:web- Django applicationdb- PostgreSQL databaseredis- Redis cache/brokercelery- Celery workercelery-beat- Celery Beat schedulerflower- Celery monitoring dashboard
- Generate
.dockerignore - Install
flowerpackage
📚 Adding API Documentation
Add Swagger/ReDoc API documentation:
djboost add api-docs swagger # Add Swagger UI
djboost add api-docs redoc # Add ReDoc
djboost add api-docs both # Add both
After adding, access your API docs at:
- Swagger UI:
http://localhost:8000/api/schema/swagger-ui/ - ReDoc:
http://localhost:8000/api/schema/redoc/
📊 Response Format
All responses follow a consistent format:
Success Response:
{
"success": true,
"message": "Data retrieved successfully.",
"data": [...]
}
Paginated Response:
{
"success": true,
"message": "Data retrieved successfully.",
"data": [...],
"meta": {
"count": 100,
"total_pages": 10,
"current_page": 1,
"page_size": 10
}
}
Error Response:
{
"success": false,
"message": "Invalid email or password.",
"data": null,
"errors": {
"email": ["This field is required."]
}
}
Usage in Views
from common.responses import success_response, error_response
from common.pagination import CustomPagination
# Success response
return success_response(message="User created", data=user_data)
# Error response
return error_response(message="Invalid credentials", status_code=401)
# Pagination
paginator = CustomPagination()
return paginator.paginate_data(
queryset=users,
request=request,
serializer_class=UserSerializer,
)
🏃 Running Your Project
python manage.py migrate
python manage.py runserver
| URL | Description |
|---|---|
http://127.0.0.1:8000/ |
Health check |
http://127.0.0.1:8000/admin/ |
Django Admin |
http://127.0.0.1:8000/api/schema/swagger-ui/ |
Swagger UI |
http://127.0.0.1:8000/api/schema/redoc/ |
ReDoc |
With Docker
docker-compose up --build
📖 CLI Reference
djboost --version # Show version
djboost --help # Show help
# Create commands
djboost create project [NAME] # Create new Django project (default: core)
djboost create app NAME # Create standard app with directory structure
djboost create accounts # Create full accounts app with auth APIs
# Add commands
djboost add cicd github|gitlab # Add CI/CD pipeline
djboost add celery # Add Celery worker + packages
djboost add celery-beat # Add Celery Beat scheduler
djboost add docker # Add Docker configuration
djboost add api-docs swagger|redoc|both # Add API documentation
# Remove commands
djboost remove cicd github|gitlab # Remove CI/CD pipeline
djboost remove celery # Remove Celery + uninstall packages
📦 Dependencies
Essential (installed with create project):
- Django REST Framework + Simple JWT
- django-cors-headers, python-decouple, Pillow
- drf-spectacular, whitenoise
- pytest, black, flake8, isort
Optional (add only when needed):
djboost add celery→ celery, redisdjboost add docker→ flower
📋 Requirements
- Python 3.10+
- Virtual environment (djboost will warn you if not activated)
📄 License
MIT — Munjur Alom
Release files for djboost 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djboost-0.3.2.tar.gz | 39.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djboost-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.5 kB
Release files / djboost-0.3.2.tar.gz
| Download URL | djboost-0.3.2.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d9c3d15488a325d8386de96fd45b92b5e7a7637dae02691e3560c089d3627cd
|
|
BLAKE2b-256 checksum How to use checksums |
104d076f3ecc9669f5c7784204326bb2ca1fb53036fa67c721e09f290222839c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / djboost-0.3.2-py3-none-any.whl
| Download URL | djboost-0.3.2-py3-none-any.whl |
|---|---|
| Size | 48.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23d8bb2fd34f1ff6707532007c05dcd0fec6adb465a67dc2ab2f85cfddf2cac4
|
|
BLAKE2b-256 checksum How to use checksums |
62c9696d2560797811e978598996378a929d34f337a646cff1aa98ebc08be83b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|