From 2b219d39b097fdc18f5bec0c25d793b92d9c5092 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 11 May 2026 00:57:37 +0545 Subject: [PATCH] =?UTF-8?q?feat(root):=20Add=20comprehensive=20Django=20pr?= =?UTF-8?q?oject=20template=20with=20modern=20scaffoldingNew=20Features=20?= =?UTF-8?q?-=20Modern=20project=20structure=20with=20environment=E2=80=91s?= =?UTF-8?q?pecific=20settings=20-=20Pre=E2=80=91configured=20REST=20API=20?= =?UTF-8?q?with=20JWT=20authentication=20-=20Split=20settings=20for=20deve?= =?UTF-8?q?lopment=20and=20production=20-=20API=20documentation=20via=20Sw?= =?UTF-8?q?agger=20UI-=20CORS=20configured=20for=20local=20development=20-?= =?UTF-8?q?=20WhiteNoise=20for=20static=20files=20-=20Modern=20admin=20int?= =?UTF-8?q?erface=20(django=E2=80=91jazzmin)=20-=20Docker=20support=20(Doc?= =?UTF-8?q?kerfile,=20docker=E2=80=91compose.yml)=20-=20Frontend=20integra?= =?UTF-8?q?tion=20with=20Vite=20+=20React/Vue=20via=20django=E2=80=91vite?= =?UTF-8?q?=20-=20Testing=20framework=20(pytest,=20pytest=E2=80=91django,?= =?UTF-8?q?=20pytest=E2=80=91cov)=20-=20Async=20task=20queues:=20Django?= =?UTF-8?q?=E2=80=91Q2=20and=20Celery=20with=20Redis=20-=20Production?= =?UTF-8?q?=E2=80=91ready=20configuration=20(Procfile,=20runtime.txt)=20-?= =?UTF-8?q?=20Development=20tools=20via=20Justfile=20-=20Environment=20tem?= =?UTF-8?q?plate=20(.env.sample)=20and=20Git=E2=80=91ready=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhancements - Refactored layout with separate config modules (base, development, production) - Organized API endpoints by model under `api/` directory - Updated README with detailed setup instructions and command shortcuts - Added Justfile with common development commands Bug Fixes - (none) --- src/djinit/templates/project/readme.md-tpl | 92 +++++++++++++++++++--- 1 file changed, 81 insertions(+), 11 deletions(-) diff --git a/src/djinit/templates/project/readme.md-tpl b/src/djinit/templates/project/readme.md-tpl index 9c28632..1849738 100644 --- a/src/djinit/templates/project/readme.md-tpl +++ b/src/djinit/templates/project/readme.md-tpl @@ -1,13 +1,35 @@ # [[ project_name ]] -A Django project folder structure is generated with [djinitx/djinit/dj](https://github.com/S4NKALP/djinit). +A Django project generated with [djinitx/djinit/dj](https://github.com/S4NKALP/djinit). ## Features - Modern project structure with environment-specific settings - Pre-configured REST API with JWT authentication -- Essential dependencies and utilities -- Production-ready configuration +- Split settings for development and production +- API documentation (Swagger UI at `/docs/`) +- CORS configured for local development +- WhiteNoise for static files +- Modern admin interface (django-jazzmin) +# @IF use_docker +- Docker support (Dockerfile, docker-compose.yml) +# @ENDIF +# @IF use_vite | use_vue +- Frontend integration (Vite + React or Vue.js via django-vite) +# @ENDIF +# @IF use_pytest +- Testing framework (pytest, pytest-django, pytest-cov) +# @ENDIF +# @IF use_django_q +- Async task queue (Django-Q2) +# @ENDIF +# @IF use_celery +- Async task queue (Celery with Redis broker) +# @ENDIF +- Production-ready configuration (Procfile, runtime.txt) +- Development tools (Justfile with common commands) +- Environment template (.env.sample) +- Git ready (.gitignore included) ## Setup @@ -158,6 +180,33 @@ Run `just` to see all available commands, including: ├── Procfile ├── runtime.txt └── README.md +# @ELSEIF single_structure +[[ project_name ]]/ +├── [[ module_name ]]/ +│ ├── settings/ +│ │ ├── base.py +│ │ ├── development.py +│ │ └── production.py +│ ├── urls.py +│ ├── wsgi.py +│ └── asgi.py +├── admin/ +├── api/ # API endpoints organized by model +│ └── user/ # Example: if you have a User model +│ ├── views.py +│ ├── serializers.py +│ └── urls.py +├── models/ +├── tests/ +├── manage.py +├── requirements.txt +├── pyproject.toml +├── uv.lock +├── .env.sample +├── justfile +├── Procfile +├── runtime.txt +└── README.md # @ELSE [[ project_name ]]/ ├── [[ module_name ]]/ @@ -182,15 +231,10 @@ Run `just` to see all available commands, including: ├── pyproject.toml ├── uv.lock ├── .env.sample +├── justfile +├── Procfile +├── runtime.txt └── README.md - -**Note:** For the single folder layout, organize your API endpoints by model name under the `api/` directory. -For example, if you have a `User` model in `models/user.py`, create: -- `api/user/views.py` - API views for User -- `api/user/serializers.py` - Serializers for User -- `api/user/urls.py` - URL patterns for User endpoints - -See the README files in `api/` and `models/` directories for more details. # @ENDIF ``` @@ -199,3 +243,29 @@ See the README files in `api/` and `models/` directories for more details. When running in development mode, API documentation is available at: - Swagger UI: http://localhost:8000/docs/ - Schema: http://localhost:8000/schema/ + +# @IF use_django_q +## Django-Q2 + +Django-Q2 is a task queue for Django. To start the worker: + +```bash +python manage.py qcluster +``` +# @ENDIF + +# @IF use_celery +## Celery + +Celery is a distributed task queue. To start the worker: + +```bash +celery -A [[ module_name ]] worker -l info +``` + +To start the beat scheduler: + +```bash +celery -A [[ module_name ]] beat -l info +``` +# @ENDIF