djinit helps you set up a production‑ready Django project in minutes. No more copy‑pasting settings or manually wiring up apps—just answer a few questions and get a modern Django project with REST API, authentication, documentation, and deployment configs ready to go.
Starting a Django project usually means spending hours setting up the same things: splitting settings for dev/prod, configuring DRF, adding JWT auth, setting up CORS, preparing for deployment. djinit does all of this for you with sensible defaults and lets you choose the project structure that fits your needs.
Recommended (using pipx):
pipx install djinitxOr with pip:
pip install djinitxOr with uv:
uv tool install djinitxRequirements: Python 3.13+
djinit setupor the shorter alias:
dj setupThe wizard will ask you a few questions:
-
What structure do you want?
- Standard – Classic Django layout with split settings
- Predefined – Organized with
apps/andapi/folders (great for larger projects) - Unified – Everything under
core/andapps/(clean and minimal) - Single Folder – All apps in one configurable folder (simple and flat)
-
Project Setup – Destination directory (use
.for current) and project name. -
Database Configuration – Choose
DATABASE_URL(recommended) or individual variables; pick PostgreSQL or MySQL. -
Django Apps (Standard structure only) – Whether to create an
apps/folder and which apps to scaffold. -
CI/CD Pipeline – GitHub Actions, GitLab CI, both, or skip it.
That’s it—your project will be ready with everything configured.
- Split settings for development and production
- Django REST Framework with JWT authentication
- API documentation (Swagger UI at
/docs/) - CORS configured for local development
- WhiteNoise for static files
- PostgreSQL support (SQLite for dev)
- Modern admin interface (
django-jazzmin) - Deployment ready with
Procfileandruntime.txt - Development tools (
Justfilewith common commands) - Environment template (
.env.sample) - Git ready (
.gitignoreincluded)
djinit setupdjinit app users products ordersCreates the apps, adds them to INSTALLED_APPS, and wires up URLs.
djinit secretUse --count 5 to generate five keys or --length 64 to change the length.
myproject/
├── manage.py
├── myproject/ # Config module
│ ├── settings/ # Split settings
│ ├── urls.py
│ └── wsgi.py
└── apps/ # Your apps (optional)
└── users/
myproject/
├── manage.py
├── project/ # Configurable folder name
│ ├── settings/
│ ├── urls.py
│ ├── models/ # All models here
│ ├── api/ # API views & serializers
│ │ └── your_model_name/
│ │ ├── views.py
│ │ ├── serializers.py
│ │ └── urls.py
│ └── wsgi.py
myproject/
├── manage.py
├── config/ # Django config
│ ├── settings/
│ └── urls.py
├── apps/ # Business logic
│ ├── users/
│ └── core/
└── api/ # API routes
└── v1/
myproject/
├── manage.py
├── core/ # Django config
│ ├── settings/
│ └── urls.py
└── apps/ # Main application package
├── admin/
├── models/
├── serializers/
├── views/
├── urls/
└── api/ # API routes
Your project ships with a Justfile for common tasks:
just dev # Start dev server
just migrate # Run migrations
just makemigrations # Create migrations
just shell # Django shell
just test # Run tests
just format # Format code
just lint # Lint codeIf you don’t have just installed, these are just shortcuts for the equivalent Django commands.
- Django – Web framework
- Django REST Framework – API toolkit
- djangorestframework‑simplejwt – JWT authentication
- drf‑spectacular – OpenAPI/Swagger docs
- django‑cors‑headers – CORS handling
- django‑jazzmin – Modern admin UI
- whitenoise – Static file serving
- psycopg2‑binary – PostgreSQL driver
- gunicorn – Production WSGI server
- python‑dotenv –
.envhandling
| Endpoint | Description |
|---|---|
/admin/ |
Django admin |
/token/ |
Obtain JWT token |
/token/refresh/ |
Refresh JWT token |
/docs/ |
Swagger UI (dev only) |
/schema/ |
OpenAPI schema (dev only) |
- Development – SQLite,
DEBUG=True, console email backend, permissive CORS. - Production – PostgreSQL, hardened security settings, SMTP email backend, strict CORS.
Copy the sample file and fill in your values:
cp .env.sample .envSECRET_KEY=your-secret-key-here # Generate with: djinit secret
DATABASE_URL=postgres://user:pass@host:5432/db
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.comSQLite works out of the box for development—no extra DB setup required.
The following items are tracked in TODO.md and represent the near‑future direction of djinit.
- Docker Support – Auto‑generate a
Dockerfilefor containerized deployments. - Frontend Integration – Scaffold React, Vue, or HTMX alongside the Django backend.
- Celery Integration – Simplify background task setup with Celery.
- More Packages – Add optional integrations for popular Django packages.
- Add more project structure templates – Expand the set of ready‑made layouts.
- Add testing framework setup – Provide pytest and coverage configuration out of the box.
- Fix bugs – Ongoing maintenance and bug resolution.
- Interactive configuration wizard – Streamlined project creation experience.
- Improved structure detection – Smarter detection of existing Django layouts.
Contributions that address any of the above items are highly welcome!
Found a bug or have an idea? Open an issue or submit a pull request. Contributions are always welcome!
- Fork the repository.
- Create a feature branch (
git checkout -b feature/awesome-feature). - Make your changes and ensure tests pass (
just test). - Submit a pull request with a clear description of the change.
Please follow the existing code style (ruff + black) and include tests for new functionality.
MIT © Sankalp Tharu
© 2024 Sankalp Tharu. All rights reserved.