Production-ready Django project scaffolding in one command
Project description
djsuite
Production-ready Django project scaffolding in one command.
Generates a fully-configured Django + DRF project with Docker, CI/CD, Celery, PostgreSQL, and cloud deployment — so you ship features on day one, not boilerplate.
Why djsuite?
Every production Django project needs the same foundation: DRF, JWT auth, Celery workers, PostgreSQL, Docker, CI/CD pipelines, and deployment config. Setting this up by hand takes hours and inevitably drifts between projects.
djsuite solves this. One command generates ~50 files with a proven
structure — and when the template evolves, --update-* flags push changes
to existing projects without touching your custom code.
Install
pip install djsuite
Or with pipx (recommended for CLI tools):
pipx install djsuite
Quick Start
# Create a new project
djsuite myproject --description "Payments API"
# Preview what would be created
djsuite myproject --dry-run
# List all generated files
djsuite --list-files
created .env
created .github/workflows/ci.yml
created .github/workflows/dev-cd.yml
created Dockerfile
created main/settings.py
created base/models.py
... (~50 files total)
Running pdm lock to pin dependencies...
pdm.lock created
Project myproject created at /home/you/myproject
Next steps:
cd myproject
pdm install
cp .env .env.local # edit with your settings
pdm run migrate
pdm run startdev 8000
What You Get
Stack
| Layer | Technology |
|---|---|
| Framework | Django 5.2 + Django REST Framework 3.16 |
| Auth | SimpleJWT (access + refresh tokens) |
| Database | PostgreSQL via psycopg2 |
| Task Queue | Celery (SQS broker on AWS, configurable) |
| Storage | S3 via django-storages (with filesystem fallback in dev) |
| API Docs | drf-spectacular (Swagger / ReDoc, DEBUG only) |
| DI Container | dependency-injector |
| Package Manager | PDM |
| Containerization | Docker multi-stage + Supervisor + Nginx |
| CI/CD | GitHub Actions (lint + test + deploy) |
| Deployment | AWS Elastic Beanstalk (default, extensible) |
Generated Project Structure
myproject/
├── .djsuite.json # djsuite metadata (for update mode)
├── .env # Environment variables
├── .pre-commit-config.yaml # black + isort hooks
├── docker-compose.yml # Postgres + Redis for local dev
├── pyproject.toml # PDM project with all dependencies
├── Dockerfile # Multi-stage build (non-root user)
├── README.md # Project docs with architecture guide
├── CONTRIBUTING.md # Contributor guide
├── CHANGELOG.md # Auto-updated on production deploy
├── .github/
│ ├── copilot-instructions.md # AI assistant context
│ ├── release.yml # Release note categories
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── ci.yml # Lint + test on every PR
│ ├── auto-label.yml # Label PRs from branch prefix
│ ├── dev-cd.yml # Deploy to dev + draft release
│ └── prod-cd.yml # Deploy to prod + publish release
├── main/ # Django project config
│ ├── settings.py # Env-based config with security defaults
│ ├── celery.py # Celery app
│ ├── urls.py # API routes + Swagger UI
│ └── wsgi.py / asgi.py
├── base/ # Shared foundation app
│ ├── containers.py # Dependency injection
│ ├── models.py # TimeStampMixin base model
│ ├── views.py # Health check + Celery task status
│ ├── services/ # Service layer
│ └── tests/ # Per-app tests
└── (deployment files) # entrypoint, nginx, supervisor, EB hooks
Architecture Highlights
- Service layer pattern — business logic in
services/, not in views or serializers - Dependency injection — services wired through
dependency-injector, mock-friendly testing - Health check —
/health/endpoint checks DB connectivity (200/503) - Security defaults — HSTS, secure cookies, SSL redirect auto-enabled in production
- Trunk-based CD — branch prefix drives labels, changelogs, and deployments automatically
- Non-root Docker — container runs as unprivileged user with Nginx security headers
CLI Reference
Create Mode
djsuite <project_name> [OPTIONS]
| Option | Default | Description |
|---|---|---|
--python-version |
3.12 |
Python version for Dockerfile and pyproject.toml |
--django-version |
5.2 |
Django version constraint |
--drf-version |
3.16 |
DRF version constraint |
--author |
system username | Author name in pyproject.toml |
--description |
"" |
Project description |
--platform |
aws-eb |
Deployment platform |
--output-dir |
. |
Parent directory for the new project |
--dry-run |
Preview file list without writing anything |
Update Mode
Push template improvements to an existing project without overwriting your
custom code (main/ and base/ are never touched by updates).
djsuite --update-ci --project-dir ./myproject # CI/CD workflows
djsuite --update-docker --project-dir ./myproject # Docker files
djsuite --update-infra --project-dir ./myproject # Infrastructure files
djsuite --update-all --project-dir ./myproject # Everything updatable
djsuite --update-all --no-backup --project-dir ./myproject # Skip backup
Before overwriting, djsuite shows a diff summary and creates a timestamped
backup in .djsuite-backup/:
Updating 4 file(s) in /home/you/myproject:
[CHANGED] (+12/-3 lines) .github/workflows/ci.yml
[UNCHANGED] .github/workflows/dev-cd.yml
[NEW] .github/copilot-instructions.md
Backed up 1 file(s) to .djsuite-backup/20250211_143022
Updated 2 file(s).
| Group | Flag | Files |
|---|---|---|
| CI | --update-ci |
.github/workflows/*, copilot instructions, release config |
| Docker | --update-docker |
Dockerfile, entrypoint.sh, release.sh, supervisord configs |
| Infra | --update-infra |
.platform/**, infra/*, nginx/* |
| Root | (via --update-all) |
.env, .gitignore, README.md, pyproject.toml, etc. |
--update-all= CI + Docker + Infra + Root. Themain/andbase/apps are never updated — they belong to you.
Platform Support
| Platform | --platform |
Status |
|---|---|---|
| AWS Elastic Beanstalk | aws-eb |
Available (default) |
| Azure App Service | azure |
Planned |
| Bare Docker / Compose | docker |
Planned |
The platform is stored in .djsuite.json, so --update-* commands
automatically use the correct platform. See Contributing
for how to add a new platform.
How It Works
templates/
├── common/ # Platform-agnostic Django scaffolding
│ ├── main/ # settings.py, celery.py, urls.py, wsgi.py, ...
│ ├── base/ # models, views, DI container, pagination, ...
│ ├── github/ # CI workflow, copilot instructions, release config
│ └── (root files) # .env, pyproject.toml, manage.py, ...
└── platforms/
└── aws_eb/ # EB-specific deployment infra
├── github/workflows/ dev-cd.yml, prod-cd.yml
├── platform/hooks/ EB lifecycle hooks
├── nginx/ reverse proxy configs
└── (root files) Dockerfile, entrypoint, supervisord, ...
- Manifest merges common + platform files into a single file map
- Renderer processes
.j2files through Jinja2, copies static files verbatim - Generator writes rendered files, sets
+xon scripts, writes.djsuite.json, runspdm lock - Updater reads
.djsuite.json, re-renders selected groups, shows diffs, creates backups
CI/CD Setup
CI runs on every pull request with zero configuration — no GitHub Secrets needed.
CD (AWS EB) requires two repository secrets for deployment:
| Secret | Description |
|---|---|
AWS_ACCOUNT_ID |
Your 12-digit AWS account ID |
DEV_AWS_REGION |
Dev deployment region (e.g. eu-central-1) |
PROD_AWS_REGION |
Prod deployment region (e.g. eu-central-1) |
The CD workflows authenticate via OIDC federation — no static AWS keys. Create an IAM role named GHA-EB-Deploy with Elastic Beanstalk, ECR, and S3 permissions, and configure its trust policy for GitHub Actions.
Releasing
- Trigger the Release workflow manually via GitHub Actions (
workflow_dispatch) - The workflow computes the next semver from PR labels since the last tag:
breakinglabel → major bumpfeaturelabel → minor bumpfix,chore,docs→ patch bump
- Tests run, package is built and published to PyPI
- A GitHub release is created with categorized notes
pyproject.toml,__init__.py, andCHANGELOG.mdare updated automatically
Requires PyPI trusted publishing configured for this repository.
Contributing
See CONTRIBUTING.md for setup instructions, project structure, and how to add templates or platforms.
License
Project details
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 djsuite-0.0.1.tar.gz.
File metadata
- Download URL: djsuite-0.0.1.tar.gz
- Upload date:
- Size: 56.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
390323afef3f6a9b17980119145da482bcfeeb0466570fbb1bcef9683427a1f8
|
|
| MD5 |
ed29a8cea90dbafd02745d5a6c657fa5
|
|
| BLAKE2b-256 |
041decbe4d326d26aca1c1c9bfbe2ed0283a0a90b3215431b98a2946e35189e0
|
Provenance
The following attestation bundles were made for djsuite-0.0.1.tar.gz:
Publisher:
release.yml on prantoamt/djsuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djsuite-0.0.1.tar.gz -
Subject digest:
390323afef3f6a9b17980119145da482bcfeeb0466570fbb1bcef9683427a1f8 - Sigstore transparency entry: 947466450
- Sigstore integration time:
-
Permalink:
prantoamt/djsuite@b2ece6b0dfa2622336edf1b0a04a0e0b580e078a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/prantoamt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b2ece6b0dfa2622336edf1b0a04a0e0b580e078a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file djsuite-0.0.1-py3-none-any.whl.
File metadata
- Download URL: djsuite-0.0.1-py3-none-any.whl
- Upload date:
- Size: 58.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf5f3607e77cb14ecb9feb5c91ab1331ff2a997ce94e962571d06e5bcfbb40b9
|
|
| MD5 |
31cd8f9c250b258ced1dcb87885051cc
|
|
| BLAKE2b-256 |
a487d41e00c9eaeda860c3a284f3c4694369e3fe21e1f2e8f978f8fdfe03810f
|
Provenance
The following attestation bundles were made for djsuite-0.0.1-py3-none-any.whl:
Publisher:
release.yml on prantoamt/djsuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
djsuite-0.0.1-py3-none-any.whl -
Subject digest:
bf5f3607e77cb14ecb9feb5c91ab1331ff2a997ce94e962571d06e5bcfbb40b9 - Sigstore transparency entry: 947466458
- Sigstore integration time:
-
Permalink:
prantoamt/djsuite@b2ece6b0dfa2622336edf1b0a04a0e0b580e078a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/prantoamt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b2ece6b0dfa2622336edf1b0a04a0e0b580e078a -
Trigger Event:
workflow_dispatch
-
Statement type: