A CLI tool to setup Django project
Project description
djinit
PyPI didn't allow the original name, so you'll find it as djinitx on PyPI
A CLI that scaffolds production-ready Django projects with DRF, JWT auth, API docs, and deployment configs - all through an interactive wizard. No more copy-pasting settings or wiring up apps by hand.
pipx install djinitx
djinit setup
Installation
# Recommended - isolated environment
pipx install djinitx
# Or with uv
uv tool install djinitx
# Or with pip
pip install djinitx
Requires Python 3.13+.
Usage
Create a project
djinit setup
# or
dj setup
The wizard walks you through these choices:
- Project structure - Standard, Predefined (
apps/+api/), Unified (core/+apps/), or Single Folder - Project name and directory
- Database - PostgreSQL or MySQL;
DATABASE_URLor individual env vars - Frontend tools - Tailwind CSS, HTMX, and/or Vite (optional)
- Django apps - Name them; optionally nest under an
apps/package - CI/CD - GitHub Actions, GitLab CI, both, or none
When you're done, you have a fully configured Django project ready to run.
Add apps later
djinit app users products orders
Creates the apps, registers them in INSTALLED_APPS, and wires up URL includes.
Generate secret keys
djinit secret
djinit secret --count 5 --length 64
What You Get
Every project ships with:
- Split settings -
base.py,development.py,production.pywith sensible defaults - Django REST Framework - With JWT authentication (access + refresh tokens)
- API documentation - Swagger UI at
/docs/, ReDoc at/schema/ - CORS - Configured for local dev, locked down for production
- WhiteNoise - Static file serving, production-ready
- django-jazzmin - Modern admin interface
- Environment management -
.env.samplewithdjango-environ - Deployment configs -
Dockerfile,Procfile,runtime.txt - CI/CD pipelines - GitHub Actions and/or GitLab CI
- Task runner -
Justfilewith common commands .gitignore- Python + Node defaults
Optional add-ons when selected:
| Feature | Package | What's configured |
|---|---|---|
| Tailwind CSS | django-tailwind-cli | Settings, DaisyUI theme, Node install in Docker |
| HTMX | django-htmx | Installed app + HtmxMiddleware |
| Vite | django-vite | vite.config.ts, dev/prod mode toggles, CI build step |
Development workflow
just dev # Start dev server
just migrate # Run migrations
just test # Run tests
just lint # Lint with ruff
just format # Format with ruff
just vite # Start Vite dev server (if selected)
just dev-full # Django + Vite together (if selected)
No just installed? These map directly to Django management commands.
Project Structures
Standard
myproject/
├── manage.py
├── myproject/ # Config module
│ ├── settings/ # base.py, development.py, production.py
│ ├── urls.py
│ └── wsgi.py
└── apps/ # Your apps (optional)
└── users/
Predefined
myproject/
├── manage.py
├── config/ # Django config
│ ├── settings/
│ └── urls.py
├── apps/ # Business logic
│ ├── users/
│ └── core/
└── api/ # API routes
└── v1/
Unified
myproject/
├── manage.py
├── core/ # Django config
│ ├── settings/
│ └── urls.py
└── apps/ # Main application package
├── admin/
├── models/
├── serializers/
├── views/
├── urls/
└── api/
Single Folder
myproject/
├── manage.py
├── project/ # Configurable name
│ ├── settings/
│ ├── urls.py
│ ├── models/
│ ├── api/
│ └── wsgi.py
Environment Setup
cp .env.sample .env
SQLite works out of the box for development. Swap in your production database when you're ready.
Packages
| Package | Role |
|---|---|
| Django | Web framework |
| django-environ | Environment variable management |
| django-jazzmin | Admin UI |
| djangorestframework | REST API toolkit |
| djangorestframework-simplejwt | JWT authentication |
| drf-yasg | Swagger/OpenAPI docs |
| django-cors-headers | CORS handling |
| whitenoise | Static file serving |
| gunicorn | Production WSGI server |
| psycopg[binary] | PostgreSQL driver |
| django-tailwind-cli | Tailwind CSS (optional) |
| django-htmx | HTMX (optional) |
| django-vite | Vite bundler (optional) |
API Endpoints
| Endpoint | Description |
|---|---|
/admin/ |
Django admin |
/token/ |
Obtain JWT pair |
/token/refresh/ |
Refresh access token |
/docs/ |
Swagger UI |
/schema/ |
ReDoc |
Contributing
Contributions are welcome. Open an issue or submit a PR.
- Fork the repo
- Create a feature branch (
git checkout -b feature/whatever) - Make your changes and run
just test - Submit a pull request
Match the existing code style - ruff linting and formatting are enforced.
License
MIT © Sankalp Tharu
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 djinitx-0.3.6.tar.gz.
File metadata
- Download URL: djinitx-0.3.6.tar.gz
- Upload date:
- Size: 59.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8347a10899862488add246e4832f5443916a7ae839fbbce55c351bfdb8caf141
|
|
| MD5 |
cb45a7e195eff740600624c52f6f7247
|
|
| BLAKE2b-256 |
97114d76c6a5ed016c2d3d986927823a261e05b2dad711e8a9fe62cb4824c54c
|
File details
Details for the file djinitx-0.3.6-py3-none-any.whl.
File metadata
- Download URL: djinitx-0.3.6-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57cbf0433f59ede85d5ce468323690083d71226339ea914823bfec6aef31b776
|
|
| MD5 |
d0cd8fb7878a1647ad9314be3f8636d9
|
|
| BLAKE2b-256 |
fa60e83f9982cf68c5764605878293e21a73860903691839d07ceec2081e1365
|