djinitx 0.3.2__tar.gz → 0.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {djinitx-0.3.2 → djinitx-0.3.6}/.github/workflows/ci.yml +4 -4
- {djinitx-0.3.2 → djinitx-0.3.6}/.github/workflows/codeql.yml +1 -1
- djinitx-0.3.6/.github/workflows/dependabot-auto-merge.yml +22 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/.github/workflows/pre-commit.yml +1 -1
- {djinitx-0.3.2 → djinitx-0.3.6}/.github/workflows/publish.yml +1 -1
- {djinitx-0.3.2 → djinitx-0.3.6}/.gitignore +1 -0
- djinitx-0.3.6/PKG-INFO +252 -0
- djinitx-0.3.6/README.md +219 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/TODO.md +3 -3
- {djinitx-0.3.2 → djinitx-0.3.6}/pyproject.toml +5 -5
- djinitx-0.3.6/requirements.txt +5 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/ruff.toml +1 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/setup.py +7 -8
- djinitx-0.3.6/src/djinit/cli.py +158 -0
- djinitx-0.3.6/src/djinit/core/base.py +52 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/core/config.py +1 -1
- djinitx-0.3.6/src/djinit/core/parser.py +215 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/core/types.py +6 -0
- djinitx-0.3.6/src/djinit/creators/app.py +358 -0
- {djinitx-0.3.2/djinit/services → djinitx-0.3.6/src/djinit/creators}/files.py +206 -123
- {djinitx-0.3.2/djinit/services → djinitx-0.3.6/src/djinit/creators}/project.py +60 -24
- djinitx-0.3.2/djinit/cli.py → djinitx-0.3.6/src/djinit/creators/setup.py +39 -34
- djinitx-0.3.2/djinit/services/templates.py → djinitx-0.3.6/src/djinit/templater/__init__.py +24 -15
- djinitx-0.3.6/src/djinit/templater/base.py +75 -0
- djinitx-0.3.2/djinit/templates/components/api_readme.j2 → djinitx-0.3.6/src/djinit/templates/components/api_readme.md-tpl +3 -3
- djinitx-0.3.6/src/djinit/templates/components/apps.py-tpl +12 -0
- djinitx-0.3.2/djinit/templates/components/models_readme.j2 → djinitx-0.3.6/src/djinit/templates/components/models_readme.md-tpl +1 -1
- djinitx-0.3.6/src/djinit/templates/components/serializers.py-tpl +5 -0
- djinitx-0.3.2/djinit/templates/components/urls.j2 → djinitx-0.3.6/src/djinit/templates/components/urls.py-tpl +0 -4
- djinitx-0.3.2/djinit/templates/components/views.j2 → djinitx-0.3.6/src/djinit/templates/components/views.py-tpl +1 -1
- djinitx-0.3.2/djinit/templates/config/asgi.j2 → djinitx-0.3.6/src/djinit/templates/config/asgi.py-tpl +4 -2
- djinitx-0.3.2/djinit/templates/config/settings/base.j2 → djinitx-0.3.6/src/djinit/templates/config/settings/base.py-tpl +70 -20
- djinitx-0.3.2/djinit/templates/config/settings/development.j2 → djinitx-0.3.6/src/djinit/templates/config/settings/development.py-tpl +7 -2
- djinitx-0.3.2/djinit/templates/config/settings/production.j2 → djinitx-0.3.6/src/djinit/templates/config/settings/production.py-tpl +26 -12
- djinitx-0.3.6/src/djinit/templates/config/urls.py-tpl +125 -0
- djinitx-0.3.2/djinit/templates/config/wsgi.j2 → djinitx-0.3.6/src/djinit/templates/config/wsgi.py-tpl +4 -2
- djinitx-0.3.6/src/djinit/templates/project/Dockerfile-tpl +50 -0
- djinitx-0.3.6/src/djinit/templates/project/ci/github_actions-tpl +77 -0
- djinitx-0.3.6/src/djinit/templates/project/ci/gitlab_ci-tpl +76 -0
- djinitx-0.3.6/src/djinit/templates/project/dockerignore-tpl +26 -0
- djinitx-0.3.6/src/djinit/templates/project/env_sample-tpl +32 -0
- djinitx-0.3.2/djinit/templates/project/gitignore.j2 → djinitx-0.3.6/src/djinit/templates/project/gitignore-tpl +2 -0
- djinitx-0.3.2/djinit/templates/project/justfile.j2 → djinitx-0.3.6/src/djinit/templates/project/justfile-tpl +96 -10
- djinitx-0.3.2/djinit/templates/project/manage_py.j2 → djinitx-0.3.6/src/djinit/templates/project/manage.py-tpl +9 -1
- djinitx-0.3.6/src/djinit/templates/project/procfile-tpl +20 -0
- djinitx-0.3.2/djinit/templates/project/pyproject_toml.j2 → djinitx-0.3.6/src/djinit/templates/project/pyproject.toml-tpl +28 -5
- djinitx-0.3.2/djinit/templates/project/readme.j2 → djinitx-0.3.6/src/djinit/templates/project/readme.md-tpl +19 -11
- djinitx-0.3.2/djinit/templates/project/requirements.j2 → djinitx-0.3.6/src/djinit/templates/project/requirements-tpl +8 -5
- djinitx-0.3.6/src/djinit/templates/project/runtime_txt-tpl +1 -0
- djinitx-0.3.6/src/djinit/templates/project/vite.config.ts-tpl +44 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/ui/input.py +38 -3
- djinitx-0.3.6/src/djinit/utils/common.py +352 -0
- djinitx-0.3.6/src/djinit/utils/django.py +137 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/uv.lock +57 -109
- djinitx-0.3.2/.github/workflows/dependabot-auto-merge.yml +0 -35
- djinitx-0.3.2/PKG-INFO +0 -289
- djinitx-0.3.2/README.md +0 -256
- djinitx-0.3.2/djinit/commands/handler.py +0 -110
- djinitx-0.3.2/djinit/generator.py +0 -61
- djinitx-0.3.2/djinit/services/app.py +0 -264
- djinitx-0.3.2/djinit/templates/components/apps.j2 +0 -8
- djinitx-0.3.2/djinit/templates/components/migrations_init.j2 +0 -0
- djinitx-0.3.2/djinit/templates/components/routes.j2 +0 -18
- djinitx-0.3.2/djinit/templates/components/serializers.j2 +0 -14
- djinitx-0.3.2/djinit/templates/config/urls/base.j2 +0 -8
- djinitx-0.3.2/djinit/templates/config/urls/with_api.j2 +0 -30
- djinitx-0.3.2/djinit/templates/config/urls/with_apps.j2 +0 -31
- djinitx-0.3.2/djinit/templates/presets/predefined/api/urls.j2 +0 -7
- djinitx-0.3.2/djinit/templates/presets/predefined/api/v1/urls.j2 +0 -7
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/models.j2 +0 -8
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/serializers.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/services.j2 +0 -10
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/tests.j2 +0 -12
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/urls.j2 +0 -14
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/views.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/models.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/serializers.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/services.j2 +0 -10
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/tests.j2 +0 -12
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/urls.j2 +0 -14
- djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/views.j2 +0 -13
- djinitx-0.3.2/djinit/templates/presets/predefined/core/exceptions.j2 +0 -5
- djinitx-0.3.2/djinit/templates/presets/predefined/core/middleware/request_logger.j2 +0 -14
- djinitx-0.3.2/djinit/templates/presets/predefined/core/mixins/timestamped_model.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/predefined/core/utils/responses.j2 +0 -9
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/apps.j2 +0 -8
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/__init__.py.j2 +0 -4
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/base.py.j2 +0 -13
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/mixins.py.j2 +0 -13
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/utils/__init__.py.j2 +0 -3
- djinitx-0.3.2/djinit/templates/presets/unified/apps/core/utils/responses.py.j2 +0 -13
- djinitx-0.3.2/djinit/templates/project/ci/github_actions.j2 +0 -109
- djinitx-0.3.2/djinit/templates/project/ci/gitlab_ci.j2 +0 -133
- djinitx-0.3.2/djinit/templates/project/env_sample.j2 +0 -32
- djinitx-0.3.2/djinit/templates/project/init.j2 +0 -0
- djinitx-0.3.2/djinit/templates/project/procfile.j2 +0 -20
- djinitx-0.3.2/djinit/templates/project/runtime_txt.j2 +0 -1
- djinitx-0.3.2/djinit/utils/common.py +0 -302
- djinitx-0.3.2/djinit/utils/django.py +0 -89
- djinitx-0.3.2/requirements.txt +0 -7
- {djinitx-0.3.2 → djinitx-0.3.6}/.github/dependabot.yml +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/.pre-commit-config.yaml +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/.python-version +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/LICENSE +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6}/MANIFEST.in +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/__init__.py +0 -0
- {djinitx-0.3.2/djinit/commands → djinitx-0.3.6/src/djinit/core}/__init__.py +0 -0
- {djinitx-0.3.2/djinit/core → djinitx-0.3.6/src/djinit/creators}/__init__.py +0 -0
- /djinitx-0.3.2/djinit/templates/components/admin.j2 → /djinitx-0.3.6/src/djinit/templates/components/admin.py-tpl +0 -0
- /djinitx-0.3.2/djinit/templates/components/models.j2 → /djinitx-0.3.6/src/djinit/templates/components/models.py-tpl +0 -0
- /djinitx-0.3.2/djinit/templates/components/tests.j2 → /djinitx-0.3.6/src/djinit/templates/components/tests.py-tpl +0 -0
- /djinitx-0.3.2/djinit/services/__init__.py → /djinitx-0.3.6/src/djinit/templates/project/init.py-tpl +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/ui/__init__.py +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/ui/console.py +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/utils/__init__.py +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/utils/exceptions.py +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/utils/secretkey.py +0 -0
- {djinitx-0.3.2 → djinitx-0.3.6/src}/djinit/utils/validators.py +0 -0
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
python-version: ["3.13"]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v7
|
|
20
20
|
|
|
21
21
|
- name: Set up Python ${{ matrix.python-version }}
|
|
22
22
|
uses: actions/setup-python@v6
|
|
@@ -31,15 +31,15 @@ jobs:
|
|
|
31
31
|
|
|
32
32
|
- name: Lint with Ruff
|
|
33
33
|
run: |
|
|
34
|
-
ruff check djinit/
|
|
34
|
+
ruff check src/djinit/
|
|
35
35
|
|
|
36
36
|
- name: Check formatting with Ruff
|
|
37
37
|
run: |
|
|
38
|
-
ruff format --check djinit/
|
|
38
|
+
ruff format --check src/djinit/
|
|
39
39
|
|
|
40
40
|
- name: Test CLI import
|
|
41
41
|
run: |
|
|
42
|
-
python -c "from djinit.
|
|
42
|
+
python -c "from djinit.cli import main; print('Import successful')"
|
|
43
43
|
|
|
44
44
|
- name: Test console script entry point
|
|
45
45
|
run: |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Dependabot Auto-Merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
dependabot:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
# Check that it's actually dependabot
|
|
15
|
+
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
|
16
|
+
steps:
|
|
17
|
+
- name: Merge PR from Dependabot
|
|
18
|
+
uses: fastify/github-action-merge-dependabot@v3
|
|
19
|
+
with:
|
|
20
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
use-github-auto-merge: true
|
|
22
|
+
target: squash
|
djinitx-0.3.6/PKG-INFO
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: djinitx
|
|
3
|
+
Version: 0.3.6
|
|
4
|
+
Summary: A CLI tool to setup Django project
|
|
5
|
+
Project-URL: Homepage, https://github.com/S4NKALP/djinit
|
|
6
|
+
Author-email: Sankalp Tharu <sankalptharu50028@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: cli,dj,django,django project,django starter,django-init,djinit,djinitx,project
|
|
10
|
+
Classifier: Environment :: Web Environment
|
|
11
|
+
Classifier: Framework :: Django
|
|
12
|
+
Classifier: Framework :: Django :: 4.2
|
|
13
|
+
Classifier: Framework :: Django :: 5.1
|
|
14
|
+
Classifier: Framework :: Django :: 5.2
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
26
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: questionary>=2.0.1
|
|
30
|
+
Requires-Dist: rich>=14.2.0
|
|
31
|
+
Requires-Dist: typer>=0.21.1
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# djinit
|
|
35
|
+
|
|
36
|
+
> PyPI didn't allow the original name, so you'll find it as **djinitx** on PyPI
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
|
|
40
|
+
<img src="https://img.shields.io/pypi/v/djinitx?color=blue&label=PyPI&logo=pypi&logoColor=white" alt="PyPI">
|
|
41
|
+
<img src="https://img.shields.io/badge/Django-5.1%20%7C%205.2%20%7C%206.0-0C4B33?logo=django&logoColor=white" alt="Django">
|
|
42
|
+
<img src="https://img.shields.io/badge/Python-3.13%2B-3776AB?logo=python&logoColor=white" alt="Python">
|
|
43
|
+
<a href="https://github.com/S4NKALP/djinit/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pipx install djinitx
|
|
51
|
+
djinit setup
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Recommended - isolated environment
|
|
58
|
+
pipx install djinitx
|
|
59
|
+
|
|
60
|
+
# Or with uv
|
|
61
|
+
uv tool install djinitx
|
|
62
|
+
|
|
63
|
+
# Or with pip
|
|
64
|
+
pip install djinitx
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Requires Python 3.13+.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Create a project
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
djinit setup
|
|
75
|
+
# or
|
|
76
|
+
dj setup
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The wizard walks you through these choices:
|
|
80
|
+
|
|
81
|
+
1. **Project structure** - Standard, Predefined (`apps/` + `api/`), Unified (`core/` + `apps/`), or Single Folder
|
|
82
|
+
2. **Project name and directory**
|
|
83
|
+
3. **Database** - PostgreSQL or MySQL; `DATABASE_URL` or individual env vars
|
|
84
|
+
4. **Frontend tools** - Tailwind CSS, HTMX, and/or Vite (optional)
|
|
85
|
+
5. **Django apps** - Name them; optionally nest under an `apps/` package
|
|
86
|
+
6. **CI/CD** - GitHub Actions, GitLab CI, both, or none
|
|
87
|
+
|
|
88
|
+
When you're done, you have a fully configured Django project ready to run.
|
|
89
|
+
|
|
90
|
+
### Add apps later
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
djinit app users products orders
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Creates the apps, registers them in `INSTALLED_APPS`, and wires up URL includes.
|
|
97
|
+
|
|
98
|
+
### Generate secret keys
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
djinit secret
|
|
102
|
+
djinit secret --count 5 --length 64
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## What You Get
|
|
106
|
+
|
|
107
|
+
Every project ships with:
|
|
108
|
+
|
|
109
|
+
- **Split settings** - `base.py`, `development.py`, `production.py` with sensible defaults
|
|
110
|
+
- **Django REST Framework** - With JWT authentication (access + refresh tokens)
|
|
111
|
+
- **API documentation** - Swagger UI at `/docs/`, ReDoc at `/schema/`
|
|
112
|
+
- **CORS** - Configured for local dev, locked down for production
|
|
113
|
+
- **WhiteNoise** - Static file serving, production-ready
|
|
114
|
+
- **django-jazzmin** - Modern admin interface
|
|
115
|
+
- **Environment management** - `.env.sample` with `django-environ`
|
|
116
|
+
- **Deployment configs** - `Dockerfile`, `Procfile`, `runtime.txt`
|
|
117
|
+
- **CI/CD pipelines** - GitHub Actions and/or GitLab CI
|
|
118
|
+
- **Task runner** - `Justfile` with common commands
|
|
119
|
+
- **`.gitignore`** - Python + Node defaults
|
|
120
|
+
|
|
121
|
+
Optional add-ons when selected:
|
|
122
|
+
|
|
123
|
+
| Feature | Package | What's configured |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| Tailwind CSS | django-tailwind-cli | Settings, DaisyUI theme, Node install in Docker |
|
|
126
|
+
| HTMX | django-htmx | Installed app + HtmxMiddleware |
|
|
127
|
+
| Vite | django-vite | `vite.config.ts`, dev/prod mode toggles, CI build step |
|
|
128
|
+
|
|
129
|
+
### Development workflow
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
just dev # Start dev server
|
|
133
|
+
just migrate # Run migrations
|
|
134
|
+
just test # Run tests
|
|
135
|
+
just lint # Lint with ruff
|
|
136
|
+
just format # Format with ruff
|
|
137
|
+
just vite # Start Vite dev server (if selected)
|
|
138
|
+
just dev-full # Django + Vite together (if selected)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
No `just` installed? These map directly to Django management commands.
|
|
142
|
+
|
|
143
|
+
## Project Structures
|
|
144
|
+
|
|
145
|
+
### Standard
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
myproject/
|
|
149
|
+
├── manage.py
|
|
150
|
+
├── myproject/ # Config module
|
|
151
|
+
│ ├── settings/ # base.py, development.py, production.py
|
|
152
|
+
│ ├── urls.py
|
|
153
|
+
│ └── wsgi.py
|
|
154
|
+
└── apps/ # Your apps (optional)
|
|
155
|
+
└── users/
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Predefined
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
myproject/
|
|
162
|
+
├── manage.py
|
|
163
|
+
├── config/ # Django config
|
|
164
|
+
│ ├── settings/
|
|
165
|
+
│ └── urls.py
|
|
166
|
+
├── apps/ # Business logic
|
|
167
|
+
│ ├── users/
|
|
168
|
+
│ └── core/
|
|
169
|
+
└── api/ # API routes
|
|
170
|
+
└── v1/
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Unified
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
myproject/
|
|
177
|
+
├── manage.py
|
|
178
|
+
├── core/ # Django config
|
|
179
|
+
│ ├── settings/
|
|
180
|
+
│ └── urls.py
|
|
181
|
+
└── apps/ # Main application package
|
|
182
|
+
├── admin/
|
|
183
|
+
├── models/
|
|
184
|
+
├── serializers/
|
|
185
|
+
├── views/
|
|
186
|
+
├── urls/
|
|
187
|
+
└── api/
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Single Folder
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
myproject/
|
|
194
|
+
├── manage.py
|
|
195
|
+
├── project/ # Configurable name
|
|
196
|
+
│ ├── settings/
|
|
197
|
+
│ ├── urls.py
|
|
198
|
+
│ ├── models/
|
|
199
|
+
│ ├── api/
|
|
200
|
+
│ └── wsgi.py
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Environment Setup
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
cp .env.sample .env
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
SQLite works out of the box for development. Swap in your production database when you're ready.
|
|
210
|
+
|
|
211
|
+
## Packages
|
|
212
|
+
|
|
213
|
+
| Package | Role |
|
|
214
|
+
|---|---|
|
|
215
|
+
| Django | Web framework |
|
|
216
|
+
| django-environ | Environment variable management |
|
|
217
|
+
| django-jazzmin | Admin UI |
|
|
218
|
+
| djangorestframework | REST API toolkit |
|
|
219
|
+
| djangorestframework-simplejwt | JWT authentication |
|
|
220
|
+
| drf-yasg | Swagger/OpenAPI docs |
|
|
221
|
+
| django-cors-headers | CORS handling |
|
|
222
|
+
| whitenoise | Static file serving |
|
|
223
|
+
| gunicorn | Production WSGI server |
|
|
224
|
+
| psycopg[binary] | PostgreSQL driver |
|
|
225
|
+
| django-tailwind-cli | Tailwind CSS _(optional)_ |
|
|
226
|
+
| django-htmx | HTMX _(optional)_ |
|
|
227
|
+
| django-vite | Vite bundler _(optional)_ |
|
|
228
|
+
|
|
229
|
+
## API Endpoints
|
|
230
|
+
|
|
231
|
+
| Endpoint | Description |
|
|
232
|
+
|---|---|
|
|
233
|
+
| `/admin/` | Django admin |
|
|
234
|
+
| `/token/` | Obtain JWT pair |
|
|
235
|
+
| `/token/refresh/` | Refresh access token |
|
|
236
|
+
| `/docs/` | Swagger UI |
|
|
237
|
+
| `/schema/` | ReDoc |
|
|
238
|
+
|
|
239
|
+
## Contributing
|
|
240
|
+
|
|
241
|
+
Contributions are welcome. Open an issue or submit a PR.
|
|
242
|
+
|
|
243
|
+
1. Fork the repo
|
|
244
|
+
2. Create a feature branch (`git checkout -b feature/whatever`)
|
|
245
|
+
3. Make your changes and run `just test`
|
|
246
|
+
4. Submit a pull request
|
|
247
|
+
|
|
248
|
+
Match the existing code style - ruff linting and formatting are enforced.
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
MIT © [Sankalp Tharu](https://sankalptharu.com.np)
|
djinitx-0.3.6/README.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# djinit
|
|
2
|
+
|
|
3
|
+
> PyPI didn't allow the original name, so you'll find it as **djinitx** on PyPI
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
<img src="https://img.shields.io/pypi/v/djinitx?color=blue&label=PyPI&logo=pypi&logoColor=white" alt="PyPI">
|
|
8
|
+
<img src="https://img.shields.io/badge/Django-5.1%20%7C%205.2%20%7C%206.0-0C4B33?logo=django&logoColor=white" alt="Django">
|
|
9
|
+
<img src="https://img.shields.io/badge/Python-3.13%2B-3776AB?logo=python&logoColor=white" alt="Python">
|
|
10
|
+
<a href="https://github.com/S4NKALP/djinit/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pipx install djinitx
|
|
18
|
+
djinit setup
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Recommended - isolated environment
|
|
25
|
+
pipx install djinitx
|
|
26
|
+
|
|
27
|
+
# Or with uv
|
|
28
|
+
uv tool install djinitx
|
|
29
|
+
|
|
30
|
+
# Or with pip
|
|
31
|
+
pip install djinitx
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires Python 3.13+.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Create a project
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
djinit setup
|
|
42
|
+
# or
|
|
43
|
+
dj setup
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The wizard walks you through these choices:
|
|
47
|
+
|
|
48
|
+
1. **Project structure** - Standard, Predefined (`apps/` + `api/`), Unified (`core/` + `apps/`), or Single Folder
|
|
49
|
+
2. **Project name and directory**
|
|
50
|
+
3. **Database** - PostgreSQL or MySQL; `DATABASE_URL` or individual env vars
|
|
51
|
+
4. **Frontend tools** - Tailwind CSS, HTMX, and/or Vite (optional)
|
|
52
|
+
5. **Django apps** - Name them; optionally nest under an `apps/` package
|
|
53
|
+
6. **CI/CD** - GitHub Actions, GitLab CI, both, or none
|
|
54
|
+
|
|
55
|
+
When you're done, you have a fully configured Django project ready to run.
|
|
56
|
+
|
|
57
|
+
### Add apps later
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
djinit app users products orders
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Creates the apps, registers them in `INSTALLED_APPS`, and wires up URL includes.
|
|
64
|
+
|
|
65
|
+
### Generate secret keys
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
djinit secret
|
|
69
|
+
djinit secret --count 5 --length 64
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## What You Get
|
|
73
|
+
|
|
74
|
+
Every project ships with:
|
|
75
|
+
|
|
76
|
+
- **Split settings** - `base.py`, `development.py`, `production.py` with sensible defaults
|
|
77
|
+
- **Django REST Framework** - With JWT authentication (access + refresh tokens)
|
|
78
|
+
- **API documentation** - Swagger UI at `/docs/`, ReDoc at `/schema/`
|
|
79
|
+
- **CORS** - Configured for local dev, locked down for production
|
|
80
|
+
- **WhiteNoise** - Static file serving, production-ready
|
|
81
|
+
- **django-jazzmin** - Modern admin interface
|
|
82
|
+
- **Environment management** - `.env.sample` with `django-environ`
|
|
83
|
+
- **Deployment configs** - `Dockerfile`, `Procfile`, `runtime.txt`
|
|
84
|
+
- **CI/CD pipelines** - GitHub Actions and/or GitLab CI
|
|
85
|
+
- **Task runner** - `Justfile` with common commands
|
|
86
|
+
- **`.gitignore`** - Python + Node defaults
|
|
87
|
+
|
|
88
|
+
Optional add-ons when selected:
|
|
89
|
+
|
|
90
|
+
| Feature | Package | What's configured |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| Tailwind CSS | django-tailwind-cli | Settings, DaisyUI theme, Node install in Docker |
|
|
93
|
+
| HTMX | django-htmx | Installed app + HtmxMiddleware |
|
|
94
|
+
| Vite | django-vite | `vite.config.ts`, dev/prod mode toggles, CI build step |
|
|
95
|
+
|
|
96
|
+
### Development workflow
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
just dev # Start dev server
|
|
100
|
+
just migrate # Run migrations
|
|
101
|
+
just test # Run tests
|
|
102
|
+
just lint # Lint with ruff
|
|
103
|
+
just format # Format with ruff
|
|
104
|
+
just vite # Start Vite dev server (if selected)
|
|
105
|
+
just dev-full # Django + Vite together (if selected)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
No `just` installed? These map directly to Django management commands.
|
|
109
|
+
|
|
110
|
+
## Project Structures
|
|
111
|
+
|
|
112
|
+
### Standard
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
myproject/
|
|
116
|
+
├── manage.py
|
|
117
|
+
├── myproject/ # Config module
|
|
118
|
+
│ ├── settings/ # base.py, development.py, production.py
|
|
119
|
+
│ ├── urls.py
|
|
120
|
+
│ └── wsgi.py
|
|
121
|
+
└── apps/ # Your apps (optional)
|
|
122
|
+
└── users/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Predefined
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
myproject/
|
|
129
|
+
├── manage.py
|
|
130
|
+
├── config/ # Django config
|
|
131
|
+
│ ├── settings/
|
|
132
|
+
│ └── urls.py
|
|
133
|
+
├── apps/ # Business logic
|
|
134
|
+
│ ├── users/
|
|
135
|
+
│ └── core/
|
|
136
|
+
└── api/ # API routes
|
|
137
|
+
└── v1/
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Unified
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
myproject/
|
|
144
|
+
├── manage.py
|
|
145
|
+
├── core/ # Django config
|
|
146
|
+
│ ├── settings/
|
|
147
|
+
│ └── urls.py
|
|
148
|
+
└── apps/ # Main application package
|
|
149
|
+
├── admin/
|
|
150
|
+
├── models/
|
|
151
|
+
├── serializers/
|
|
152
|
+
├── views/
|
|
153
|
+
├── urls/
|
|
154
|
+
└── api/
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Single Folder
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
myproject/
|
|
161
|
+
├── manage.py
|
|
162
|
+
├── project/ # Configurable name
|
|
163
|
+
│ ├── settings/
|
|
164
|
+
│ ├── urls.py
|
|
165
|
+
│ ├── models/
|
|
166
|
+
│ ├── api/
|
|
167
|
+
│ └── wsgi.py
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Environment Setup
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
cp .env.sample .env
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
SQLite works out of the box for development. Swap in your production database when you're ready.
|
|
177
|
+
|
|
178
|
+
## Packages
|
|
179
|
+
|
|
180
|
+
| Package | Role |
|
|
181
|
+
|---|---|
|
|
182
|
+
| Django | Web framework |
|
|
183
|
+
| django-environ | Environment variable management |
|
|
184
|
+
| django-jazzmin | Admin UI |
|
|
185
|
+
| djangorestframework | REST API toolkit |
|
|
186
|
+
| djangorestframework-simplejwt | JWT authentication |
|
|
187
|
+
| drf-yasg | Swagger/OpenAPI docs |
|
|
188
|
+
| django-cors-headers | CORS handling |
|
|
189
|
+
| whitenoise | Static file serving |
|
|
190
|
+
| gunicorn | Production WSGI server |
|
|
191
|
+
| psycopg[binary] | PostgreSQL driver |
|
|
192
|
+
| django-tailwind-cli | Tailwind CSS _(optional)_ |
|
|
193
|
+
| django-htmx | HTMX _(optional)_ |
|
|
194
|
+
| django-vite | Vite bundler _(optional)_ |
|
|
195
|
+
|
|
196
|
+
## API Endpoints
|
|
197
|
+
|
|
198
|
+
| Endpoint | Description |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `/admin/` | Django admin |
|
|
201
|
+
| `/token/` | Obtain JWT pair |
|
|
202
|
+
| `/token/refresh/` | Refresh access token |
|
|
203
|
+
| `/docs/` | Swagger UI |
|
|
204
|
+
| `/schema/` | ReDoc |
|
|
205
|
+
|
|
206
|
+
## Contributing
|
|
207
|
+
|
|
208
|
+
Contributions are welcome. Open an issue or submit a PR.
|
|
209
|
+
|
|
210
|
+
1. Fork the repo
|
|
211
|
+
2. Create a feature branch (`git checkout -b feature/whatever`)
|
|
212
|
+
3. Make your changes and run `just test`
|
|
213
|
+
4. Submit a pull request
|
|
214
|
+
|
|
215
|
+
Match the existing code style - ruff linting and formatting are enforced.
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT © [Sankalp Tharu](https://sankalptharu.com.np)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Features
|
|
4
4
|
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
5
|
+
- [x] Docker Support: Auto generating `Dockerfile` so you can containerize easily
|
|
6
|
+
- [x] Frontend Integration: Options to scaffold React, Vue, or HTMX right alongside Django
|
|
7
7
|
- [ ] Celery: Making background tasks easier to set up
|
|
8
8
|
- [ ] More Packages: Integrating other popular packages to help you build feature rich apps effortlessly
|
|
9
9
|
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
|
|
12
12
|
- [ ] Add more project structure templates
|
|
13
13
|
- [x] Add interactive configuration wizard
|
|
14
|
-
- [
|
|
14
|
+
- [x] Add testing framework setup (pytest, coverage)
|
|
15
15
|
- [x] Improve structure detection
|
|
@@ -3,11 +3,11 @@ requires = ["hatchling"]
|
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[tool.hatch.build.targets.wheel]
|
|
6
|
-
packages = ["djinit"]
|
|
6
|
+
packages = ["src/djinit"]
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "djinitx"
|
|
10
|
-
version = "0.3.
|
|
10
|
+
version = "0.3.6"
|
|
11
11
|
description = "A CLI tool to setup Django project"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.10"
|
|
@@ -48,16 +48,16 @@ classifiers=[
|
|
|
48
48
|
]
|
|
49
49
|
dependencies = [
|
|
50
50
|
"rich>=14.2.0",
|
|
51
|
-
"jinja2>=3.1.0",
|
|
52
51
|
"questionary>=2.0.1",
|
|
52
|
+
"typer>=0.21.1",
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
[project.urls]
|
|
56
56
|
Homepage = "https://github.com/S4NKALP/djinit"
|
|
57
57
|
|
|
58
58
|
[project.scripts]
|
|
59
|
-
djinit = "djinit.
|
|
60
|
-
dj = "djinit.
|
|
59
|
+
djinit = "djinit.cli:app"
|
|
60
|
+
dj = "djinit.cli:app"
|
|
61
61
|
|
|
62
62
|
[dependency-groups]
|
|
63
63
|
dev = [
|
|
@@ -2,26 +2,25 @@ from setuptools import find_packages, setup
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="djinitx",
|
|
5
|
-
version="0.3.
|
|
5
|
+
version="0.3.6",
|
|
6
6
|
description="A CLI tool to setup Django projects",
|
|
7
7
|
long_description=open("README.md").read(),
|
|
8
8
|
long_description_content_type="text/markdown",
|
|
9
9
|
author="Sankalp Tharu",
|
|
10
10
|
author_email="sankalptharu50028@gmail.com",
|
|
11
11
|
url="https://github.com/S4NKALP/djinit",
|
|
12
|
-
packages=find_packages(
|
|
12
|
+
packages=find_packages(where="src"),
|
|
13
|
+
package_dir={"": "src"},
|
|
13
14
|
include_package_data=True,
|
|
14
15
|
install_requires=[
|
|
15
|
-
"ruff>=0.14.2",
|
|
16
|
-
"click>=8.3.0",
|
|
17
16
|
"rich>=14.2.0",
|
|
18
|
-
"jinja2>=3.1.0",
|
|
19
17
|
"questionary>=2.0.1",
|
|
18
|
+
"typer>=0.21.1",
|
|
20
19
|
],
|
|
21
20
|
entry_points={
|
|
22
21
|
"console_scripts": [
|
|
23
|
-
"djinit=djinit.
|
|
24
|
-
"dj=djinit.
|
|
22
|
+
"djinit=djinit.cli:app",
|
|
23
|
+
"dj=djinit.cli:app",
|
|
25
24
|
]
|
|
26
25
|
},
|
|
27
26
|
classifiers=[
|
|
@@ -55,7 +54,7 @@ setup(
|
|
|
55
54
|
"django project",
|
|
56
55
|
"django starter",
|
|
57
56
|
],
|
|
58
|
-
python_requires=">=3.
|
|
57
|
+
python_requires=">=3.10",
|
|
59
58
|
project_urls={
|
|
60
59
|
"Bug Reports": "https://github.com/S4NKALP/djinit/issues",
|
|
61
60
|
"Source": "https://github.com/S4NKALP/djinit",
|