Modular Django boilerplate
Project description
Django Boilerplate → go-django 📦
A modular, scalable, and DRY backend boilerplate built on Django. Designed to provide production-ready patterns (service, repository, serializer, view) and a CLI command to scaffold new modules with zero friction.
🚀 Features
- Modular directory structure (Django-onion architecture)
- Base classes for
Model,Repository,Service,Serializer,APIView - Unified decorator for query & body validation
- Command to scaffold CRUD-ready Django apps
- Auto admin registration
- Auto test stub generation
- Pagination and soft-delete support
📦 Installation
pip install go-django
Or for local development:
pip install -e .
🧱 Generate a Module
python manage.py generate_module <app_name> <Entity>
Example
python manage.py generate_module users User
Creates:
users/
├── __init__.py
├── admin.py
├── models.py
├── urls.py
├── repositories/
│ └── user_repository.py
├── serializers/
│ └── user_serializer.py
├── services/
│ └── user_service.py
├── views/
│ └── user_view.py
└── tests/
└── test_user_service.py
- Registers
Userinadmin.py - Adds app to
INSTALLED_APPS - Includes unit test stub for service
📚 Structure Summary
🔹 BaseModel
- Common fields:
created_at,updated_at,is_active - Methods:
soft_delete(),restore()
🔹 BaseService
- CRUD methods:
create,retrieve,update,delete - Supports pagination out of the box
🔹 BaseRepository
- ORM encapsulation:
get_by_id,filter,exists, etc.
🔹 BaseAPIView
- Handles all HTTP verbs via service layer
- Unified error handling using custom exceptions
🔹 Decorator: @validate_request
- Combines
request.dataandrequest.query_params - Injects validated data into
request.validated_data
🧪 Testing
Each generated module includes test stubs inside:
<app_name>/tests/test_<entity>_service.py
Use Django's TestCase or plug in pytest if preferred.
🧰 Advanced
- Add signals, permissions, or mixins by extending
shared/ - Create custom decorators for logging, audit, auth, etc.
✅ License
👨💻 Maintainer
Created by Sivakumar & Selva • Contributions welcome!
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 go_django-0.0.2.tar.gz.
File metadata
- Download URL: go_django-0.0.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c15ad584e13d60fdf93a557c0ec19c28fc55ba3a82ef85d33919043589c4e95
|
|
| MD5 |
ae0f65aabc6a4d7f9bd95ffb99af014e
|
|
| BLAKE2b-256 |
33404e5df73837d2ba2fd4e389297f982c026401bd9d5c70768c970de840a9ad
|
File details
Details for the file go_django-0.0.2-py3-none-any.whl.
File metadata
- Download URL: go_django-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a2a081717e9b426f8a7b50b2ad3df6c3be4343b3cb78af46a4d72e05ed62039
|
|
| MD5 |
d4b443a742539cb850e40b8dc45e330e
|
|
| BLAKE2b-256 |
dec9efc6ede12d1bcdde564465546e0a49eecfb0794ad786eb9ea2a532092ae7
|