djinitx 0.3.2__tar.gz → 0.3.4__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.
Files changed (112) hide show
  1. {djinitx-0.3.2 → djinitx-0.3.4}/.github/workflows/ci.yml +3 -3
  2. djinitx-0.3.4/.github/workflows/dependabot-auto-merge.yml +22 -0
  3. djinitx-0.3.2/djinit/templates/project/gitignore.j2 → djinitx-0.3.4/.gitignore +1 -0
  4. {djinitx-0.3.2 → djinitx-0.3.4}/PKG-INFO +86 -68
  5. djinitx-0.3.4/README.md +274 -0
  6. {djinitx-0.3.2 → djinitx-0.3.4}/TODO.md +1 -0
  7. {djinitx-0.3.2 → djinitx-0.3.4}/pyproject.toml +5 -5
  8. djinitx-0.3.4/requirements.txt +5 -0
  9. {djinitx-0.3.2 → djinitx-0.3.4}/ruff.toml +1 -0
  10. {djinitx-0.3.2 → djinitx-0.3.4}/setup.py +7 -8
  11. djinitx-0.3.4/src/djinit/cli.py +158 -0
  12. djinitx-0.3.4/src/djinit/core/base.py +52 -0
  13. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/core/config.py +1 -1
  14. djinitx-0.3.4/src/djinit/core/parser.py +215 -0
  15. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/core/types.py +4 -0
  16. djinitx-0.3.4/src/djinit/creators/app.py +358 -0
  17. {djinitx-0.3.2/djinit/services → djinitx-0.3.4/src/djinit/creators}/files.py +126 -121
  18. {djinitx-0.3.2/djinit/services → djinitx-0.3.4/src/djinit/creators}/project.py +60 -24
  19. djinitx-0.3.2/djinit/cli.py → djinitx-0.3.4/src/djinit/creators/setup.py +34 -34
  20. djinitx-0.3.2/djinit/services/templates.py → djinitx-0.3.4/src/djinit/templater/__init__.py +24 -15
  21. djinitx-0.3.4/src/djinit/templater/base.py +75 -0
  22. djinitx-0.3.2/djinit/templates/components/api_readme.j2 → djinitx-0.3.4/src/djinit/templates/components/api_readme.md-tpl +3 -3
  23. djinitx-0.3.4/src/djinit/templates/components/apps.py-tpl +12 -0
  24. djinitx-0.3.2/djinit/templates/components/models_readme.j2 → djinitx-0.3.4/src/djinit/templates/components/models_readme.md-tpl +1 -1
  25. djinitx-0.3.4/src/djinit/templates/components/serializers.py-tpl +5 -0
  26. djinitx-0.3.2/djinit/templates/components/urls.j2 → djinitx-0.3.4/src/djinit/templates/components/urls.py-tpl +0 -4
  27. djinitx-0.3.2/djinit/templates/components/views.j2 → djinitx-0.3.4/src/djinit/templates/components/views.py-tpl +1 -1
  28. djinitx-0.3.2/djinit/templates/config/asgi.j2 → djinitx-0.3.4/src/djinit/templates/config/asgi.py-tpl +1 -1
  29. djinitx-0.3.2/djinit/templates/config/settings/base.j2 → djinitx-0.3.4/src/djinit/templates/config/settings/base.py-tpl +58 -9
  30. djinitx-0.3.2/djinit/templates/config/settings/development.j2 → djinitx-0.3.4/src/djinit/templates/config/settings/development.py-tpl +1 -1
  31. djinitx-0.3.2/djinit/templates/config/settings/production.j2 → djinitx-0.3.4/src/djinit/templates/config/settings/production.py-tpl +20 -11
  32. djinitx-0.3.4/src/djinit/templates/config/urls.py-tpl +103 -0
  33. djinitx-0.3.2/djinit/templates/config/wsgi.j2 → djinitx-0.3.4/src/djinit/templates/config/wsgi.py-tpl +1 -1
  34. djinitx-0.3.2/djinit/templates/project/ci/github_actions.j2 → djinitx-0.3.4/src/djinit/templates/project/ci/github_actions-tpl +5 -5
  35. djinitx-0.3.2/djinit/templates/project/ci/gitlab_ci.j2 → djinitx-0.3.4/src/djinit/templates/project/ci/gitlab_ci-tpl +7 -7
  36. djinitx-0.3.4/src/djinit/templates/project/env_sample-tpl +32 -0
  37. djinitx-0.3.2/djinit/templates/project/justfile.j2 → djinitx-0.3.4/src/djinit/templates/project/justfile-tpl +85 -10
  38. djinitx-0.3.2/djinit/templates/project/manage_py.j2 → djinitx-0.3.4/src/djinit/templates/project/manage.py-tpl +1 -1
  39. djinitx-0.3.4/src/djinit/templates/project/procfile-tpl +20 -0
  40. djinitx-0.3.2/djinit/templates/project/pyproject_toml.j2 → djinitx-0.3.4/src/djinit/templates/project/pyproject.toml-tpl +11 -4
  41. djinitx-0.3.2/djinit/templates/project/readme.j2 → djinitx-0.3.4/src/djinit/templates/project/readme.md-tpl +19 -11
  42. djinitx-0.3.2/djinit/templates/project/requirements.j2 → djinitx-0.3.4/src/djinit/templates/project/requirements-tpl +6 -4
  43. djinitx-0.3.4/src/djinit/templates/project/runtime_txt-tpl +1 -0
  44. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/ui/input.py +27 -3
  45. djinitx-0.3.4/src/djinit/utils/common.py +352 -0
  46. djinitx-0.3.4/src/djinit/utils/django.py +135 -0
  47. {djinitx-0.3.2 → djinitx-0.3.4}/uv.lock +57 -109
  48. djinitx-0.3.2/.github/workflows/dependabot-auto-merge.yml +0 -35
  49. djinitx-0.3.2/README.md +0 -256
  50. djinitx-0.3.2/djinit/commands/handler.py +0 -110
  51. djinitx-0.3.2/djinit/generator.py +0 -61
  52. djinitx-0.3.2/djinit/services/app.py +0 -264
  53. djinitx-0.3.2/djinit/templates/components/apps.j2 +0 -8
  54. djinitx-0.3.2/djinit/templates/components/migrations_init.j2 +0 -0
  55. djinitx-0.3.2/djinit/templates/components/routes.j2 +0 -18
  56. djinitx-0.3.2/djinit/templates/components/serializers.j2 +0 -14
  57. djinitx-0.3.2/djinit/templates/config/urls/base.j2 +0 -8
  58. djinitx-0.3.2/djinit/templates/config/urls/with_api.j2 +0 -30
  59. djinitx-0.3.2/djinit/templates/config/urls/with_apps.j2 +0 -31
  60. djinitx-0.3.2/djinit/templates/presets/predefined/api/urls.j2 +0 -7
  61. djinitx-0.3.2/djinit/templates/presets/predefined/api/v1/urls.j2 +0 -7
  62. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/models.j2 +0 -8
  63. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/serializers.j2 +0 -9
  64. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/services.j2 +0 -10
  65. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/tests.j2 +0 -12
  66. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/urls.j2 +0 -14
  67. djinitx-0.3.2/djinit/templates/presets/predefined/apps/generic/views.j2 +0 -9
  68. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/models.j2 +0 -9
  69. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/serializers.j2 +0 -9
  70. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/services.j2 +0 -10
  71. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/tests.j2 +0 -12
  72. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/urls.j2 +0 -14
  73. djinitx-0.3.2/djinit/templates/presets/predefined/apps/users/views.j2 +0 -13
  74. djinitx-0.3.2/djinit/templates/presets/predefined/core/exceptions.j2 +0 -5
  75. djinitx-0.3.2/djinit/templates/presets/predefined/core/middleware/request_logger.j2 +0 -14
  76. djinitx-0.3.2/djinit/templates/presets/predefined/core/mixins/timestamped_model.j2 +0 -9
  77. djinitx-0.3.2/djinit/templates/presets/predefined/core/utils/responses.j2 +0 -9
  78. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/apps.j2 +0 -8
  79. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/__init__.py.j2 +0 -4
  80. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/base.py.j2 +0 -13
  81. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/models/mixins.py.j2 +0 -13
  82. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/utils/__init__.py.j2 +0 -3
  83. djinitx-0.3.2/djinit/templates/presets/unified/apps/core/utils/responses.py.j2 +0 -13
  84. djinitx-0.3.2/djinit/templates/project/env_sample.j2 +0 -32
  85. djinitx-0.3.2/djinit/templates/project/init.j2 +0 -0
  86. djinitx-0.3.2/djinit/templates/project/procfile.j2 +0 -20
  87. djinitx-0.3.2/djinit/templates/project/runtime_txt.j2 +0 -1
  88. djinitx-0.3.2/djinit/utils/common.py +0 -302
  89. djinitx-0.3.2/djinit/utils/django.py +0 -89
  90. djinitx-0.3.2/requirements.txt +0 -7
  91. {djinitx-0.3.2 → djinitx-0.3.4}/.github/dependabot.yml +0 -0
  92. {djinitx-0.3.2 → djinitx-0.3.4}/.github/workflows/codeql.yml +0 -0
  93. {djinitx-0.3.2 → djinitx-0.3.4}/.github/workflows/pre-commit.yml +0 -0
  94. {djinitx-0.3.2 → djinitx-0.3.4}/.github/workflows/publish.yml +0 -0
  95. {djinitx-0.3.2 → djinitx-0.3.4}/.pre-commit-config.yaml +0 -0
  96. {djinitx-0.3.2 → djinitx-0.3.4}/.python-version +0 -0
  97. {djinitx-0.3.2 → djinitx-0.3.4}/LICENSE +0 -0
  98. {djinitx-0.3.2 → djinitx-0.3.4}/MANIFEST.in +0 -0
  99. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/__init__.py +0 -0
  100. {djinitx-0.3.2/djinit/commands → djinitx-0.3.4/src/djinit/core}/__init__.py +0 -0
  101. {djinitx-0.3.2/djinit/core → djinitx-0.3.4/src/djinit/creators}/__init__.py +0 -0
  102. /djinitx-0.3.2/djinit/templates/components/admin.j2 → /djinitx-0.3.4/src/djinit/templates/components/admin.py-tpl +0 -0
  103. /djinitx-0.3.2/djinit/templates/components/models.j2 → /djinitx-0.3.4/src/djinit/templates/components/models.py-tpl +0 -0
  104. /djinitx-0.3.2/djinit/templates/components/tests.j2 → /djinitx-0.3.4/src/djinit/templates/components/tests.py-tpl +0 -0
  105. /djinitx-0.3.2/.gitignore → /djinitx-0.3.4/src/djinit/templates/project/gitignore-tpl +0 -0
  106. /djinitx-0.3.2/djinit/services/__init__.py → /djinitx-0.3.4/src/djinit/templates/project/init.py-tpl +0 -0
  107. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/ui/__init__.py +0 -0
  108. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/ui/console.py +0 -0
  109. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/utils/__init__.py +0 -0
  110. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/utils/exceptions.py +0 -0
  111. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/utils/secretkey.py +0 -0
  112. {djinitx-0.3.2 → djinitx-0.3.4/src}/djinit/utils/validators.py +0 -0
@@ -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.generator import main; print('Import successful')"
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: minor
@@ -1,6 +1,7 @@
1
1
  #--------------------------------------------------#
2
2
  # The following was generated by djinit: #
3
3
  #--------------------------------------------------#
4
+ AGENTS.md
4
5
 
5
6
  # Python
6
7
  *.py[cod]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djinitx
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: A CLI tool to setup Django project
5
5
  Project-URL: Homepage, https://github.com/S4NKALP/djinit
6
6
  Author-email: Sankalp Tharu <sankalptharu50028@gmail.com>
@@ -26,9 +26,9 @@ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
26
26
  Classifier: Topic :: Software Development :: Code Generators
27
27
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
28
  Requires-Python: >=3.10
29
- Requires-Dist: jinja2>=3.1.0
30
29
  Requires-Dist: questionary>=2.0.1
31
30
  Requires-Dist: rich>=14.2.0
31
+ Requires-Dist: typer>=0.21.1
32
32
  Description-Content-Type: text/markdown
33
33
 
34
34
  # djinit
@@ -44,7 +44,7 @@ Description-Content-Type: text/markdown
44
44
 
45
45
  </div>
46
46
 
47
- **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.
47
+ **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.
48
48
 
49
49
  ## Why djinit?
50
50
 
@@ -70,63 +70,51 @@ Or with uv:
70
70
  uv tool install djinitx
71
71
  ```
72
72
 
73
- **Requirements**: Python 3.13+
73
+ **Requirements**: Python 3.13+
74
74
 
75
75
  ## Getting Started
76
76
 
77
- Just run:
78
-
79
77
  ```bash
80
78
  djinit setup
81
79
  ```
82
80
 
83
- You can also use the shorter alias:
81
+ or the shorter alias:
84
82
 
85
83
  ```bash
86
84
  dj setup
87
85
  ```
88
86
 
89
- The tool will ask you a few questions:
87
+ The wizard will ask you a few questions:
90
88
 
91
89
  1. **What structure do you want?**
92
- - **Standard**: Classic Django layout with split settings
93
- - **Predefined**: Organized with `apps/` and `api/` folders (great for larger projects)
94
- - **Unified**: Everything under `core/` and `apps/` (clean and minimal)
95
- - **Single Folder**: All apps in one configurable folder (simple and flat)
90
+ - **Standard** – Classic Django layout with split settings
91
+ - **Predefined** – Organized with `apps/` and `api/` folders (great for larger projects)
92
+ - **Unified** – Everything under `core/` and `apps/` (clean and minimal)
93
+ - **Single Folder** – All apps in one configurable folder (simple and flat)
96
94
 
97
- 2. **Project Setup**:
98
- - Where to create it (use `.` for current directory)
99
- - Project name (or directory name for Single Folder)
95
+ 2. **Project Setup** – Destination directory (use `.` for current) and project name.
100
96
 
101
- 3. **Database Configuration**:
102
- - Use `DATABASE_URL` (cleaner, recommended)
103
- - Or separate DB variables
104
- - Choose between PostgreSQL or MySQL
97
+ 3. **Database Configuration** – Choose `DATABASE_URL` (recommended) or individual variables; pick PostgreSQL or MySQL.
105
98
 
106
- 4. **Django Apps** (Standard Structure only):
107
- - Whether to use an `apps/` folder
108
- - Which apps to create
99
+ 4. **Django Apps** *(Standard structure only)* – Whether to create an `apps/` folder and which apps to scaffold.
109
100
 
110
- 5. **CI/CD Pipeline**:
111
- - GitHub Actions, GitLab CI, both, or skip it
101
+ 5. **CI/CD Pipeline** – GitHub Actions, GitLab CI, both, or skip it.
112
102
 
113
- That's it! Your project will be ready with everything configured.
103
+ That’s it—your project will be ready with everything configured.
114
104
 
115
105
  ## What You Get
116
106
 
117
- Every project includes:
118
-
119
107
  - **Split settings** for development and production
120
108
  - **Django REST Framework** with JWT authentication
121
109
  - **API documentation** (Swagger UI at `/docs/`)
122
110
  - **CORS** configured for local development
123
- - **WhiteNoise** for serving static files
111
+ - **WhiteNoise** for static files
124
112
  - **PostgreSQL** support (SQLite for dev)
125
- - **Modern admin** interface (django-jazzmin)
126
- - **Deployment ready** with Procfile and runtime.txt
127
- - **Development tools** (Justfile with common commands)
128
- - **Environment template** (.env.sample)
129
- - **Git ready** (.gitignore included)
113
+ - **Modern admin** interface (`django-jazzmin`)
114
+ - **Deployment ready** with `Procfile` and `runtime.txt`
115
+ - **Development tools** (`Justfile` with common commands)
116
+ - **Environment template** (`.env.sample`)
117
+ - **Git ready** (`.gitignore` included)
130
118
 
131
119
  ## Commands
132
120
 
@@ -136,13 +124,13 @@ Every project includes:
136
124
  djinit setup
137
125
  ```
138
126
 
139
- ### Add Apps to Existing Project
127
+ ### Add Apps to an Existing Project
140
128
 
141
129
  ```bash
142
130
  djinit app users products orders
143
131
  ```
144
132
 
145
- This automatically creates the apps, adds them to `INSTALLED_APPS`, and wires up URLs.
133
+ Creates the apps, adds them to `INSTALLED_APPS`, and wires up URLs.
146
134
 
147
135
  ### Generate Secret Keys
148
136
 
@@ -150,14 +138,12 @@ This automatically creates the apps, adds them to `INSTALLED_APPS`, and wires up
150
138
  djinit secret
151
139
  ```
152
140
 
153
- Need more? Use `--count 5` or change length with `--length 64`.
141
+ Use `--count 5` to generate five keys or `--length 64` to change the length.
154
142
 
155
143
  ## Project Structures
156
144
 
157
145
  ### Standard Structure
158
146
 
159
- The classic Django layout with split settings:
160
-
161
147
  ```
162
148
  myproject/
163
149
  ├── manage.py
@@ -171,8 +157,6 @@ myproject/
171
157
 
172
158
  ### Single Folder Layout
173
159
 
174
- Simple structure with all apps in one folder:
175
-
176
160
  ```
177
161
  myproject/
178
162
  ├── manage.py
@@ -180,7 +164,7 @@ myproject/
180
164
  │ ├── settings/
181
165
  │ ├── urls.py
182
166
  │ ├── models/ # All models here
183
- │ ├── api/ # API views and serializers
167
+ │ ├── api/ # API views & serializers
184
168
  │ │ └── your_model_name/
185
169
  │ │ ├── views.py
186
170
  │ │ ├── serializers.py
@@ -190,8 +174,6 @@ myproject/
190
174
 
191
175
  ### Predefined Structure
192
176
 
193
- Organized for larger projects:
194
-
195
177
  ```
196
178
  myproject/
197
179
  ├── manage.py
@@ -207,8 +189,6 @@ myproject/
207
189
 
208
190
  ### Unified Structure
209
191
 
210
- Clean and minimal:
211
-
212
192
  ```
213
193
  myproject/
214
194
  ├── manage.py
@@ -226,7 +206,7 @@ myproject/
226
206
 
227
207
  ## Development Workflow
228
208
 
229
- Your project comes with a `Justfile` for common tasks:
209
+ Your project ships with a `Justfile` for common tasks:
230
210
 
231
211
  ```bash
232
212
  just dev # Start dev server
@@ -238,52 +218,90 @@ just format # Format code
238
218
  just lint # Lint code
239
219
  ```
240
220
 
241
- Don't have `just` installed? No problem—these are just shortcuts for standard Django commands.
221
+ If you don’t have `just` installed, these are just shortcuts for the equivalent Django commands.
242
222
 
243
223
  ## What's Included
244
224
 
245
225
  ### Packages
246
226
 
247
- - Django (web framework)
248
- - Django REST Framework (API)
249
- - djangorestframework-simplejwt (JWT auth)
250
- - drf-spectacular (API docs)
251
- - django-cors-headers (CORS)
252
- - django-jazzmin (modern admin)
253
- - whitenoise (static files)
254
- - psycopg2-binary (PostgreSQL)
255
- - gunicorn (production server)
256
- - python-dotenv (environment variables)
227
+ - **Django** – Web framework
228
+ - **Django REST Framework** – API toolkit
229
+ - **djangorestframework‑simplejwt** – JWT authentication
230
+ - **drf‑spectacular** – OpenAPI/Swagger docs
231
+ - **django‑cors‑headers** – CORS handling
232
+ - **django‑jazzmin** – Modern admin UI
233
+ - **whitenoise** – Static file serving
234
+ - **psycopg2‑binary** – PostgreSQL driver
235
+ - **gunicorn** – Production WSGI server
236
+ - **python‑dotenv** – `.env` handling
257
237
 
258
238
  ### API Endpoints
259
239
 
260
- - `/admin/` - Django admin
261
- - `/token/` - Get JWT token
262
- - `/token/refresh/` - Refresh token
263
- - `/docs/` - Swagger UI (dev only)
264
- - `/schema/` - OpenAPI schema (dev only)
240
+ | Endpoint | Description |
241
+ |-------------------|---------------------------------|
242
+ | `/admin/` | Django admin |
243
+ | `/token/` | Obtain JWT token |
244
+ | `/token/refresh/` | Refresh JWT token |
245
+ | `/docs/` | Swagger UI (dev only) |
246
+ | `/schema/` | OpenAPI schema (dev only) |
265
247
 
266
- ### Settings
248
+ ### Settings Overview
267
249
 
268
- **Development**: SQLite, debug mode, console emails, permissive CORS
269
- **Production**: PostgreSQL, security hardened, SMTP emails, strict CORS
250
+ - **Development** – SQLite, `DEBUG=True`, console email backend, permissive CORS.
251
+ - **Production** – PostgreSQL, hardened security settings, SMTP email backend, strict CORS.
270
252
 
271
253
  ## Environment Setup
272
254
 
273
- Copy `.env.sample` to `.env` and fill in your values:
255
+ Copy the sample file and fill in your values:
274
256
 
275
257
  ```bash
276
- SECRET_KEY=your-secret-key-here # Use: djinit secret
258
+ cp .env.sample .env
259
+ ```
260
+
261
+ ```dotenv
262
+ SECRET_KEY=your-secret-key-here # Generate with: djinit secret
277
263
  DATABASE_URL=postgres://user:pass@host:5432/db
278
264
  ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
279
265
  ```
280
266
 
281
- For development, SQLite works out of the box—no database setup needed!
267
+ SQLite works out of the box for development—no extra DB setup required.
268
+
269
+ ## Roadmap
270
+
271
+ The following items are tracked in **TODO.md** and represent the near‑future direction of djinit.
272
+
273
+ ### Planned Features
274
+ - **Docker Support** – Auto‑generate a `Dockerfile` for containerized deployments.
275
+ - **Frontend Integration** – Scaffold React, Vue, or HTMX alongside the Django backend.
276
+ - **Celery Integration** – Simplify background task setup with Celery.
277
+ - **More Packages** – Add optional integrations for popular Django packages.
278
+
279
+ ### Enhancements
280
+ - **Add more project structure templates** – Expand the set of ready‑made layouts.
281
+ - **Add testing framework setup** – Provide pytest and coverage configuration out of the box.
282
+ - **Fix bugs** – Ongoing maintenance and bug resolution.
283
+
284
+ ### Completed
285
+ - **Interactive configuration wizard** – Streamlined project creation experience.
286
+ - **Improved structure detection** – Smarter detection of existing Django layouts.
287
+
288
+ > Contributions that address any of the above items are highly welcome!
282
289
 
283
290
  ## Contributing
284
291
 
285
292
  Found a bug or have an idea? Open an issue or submit a pull request. Contributions are always welcome!
286
293
 
294
+ 1. Fork the repository.
295
+ 2. Create a feature branch (`git checkout -b feature/awesome-feature`).
296
+ 3. Make your changes and ensure tests pass (`just test`).
297
+ 4. Submit a pull request with a clear description of the change.
298
+
299
+ Please follow the existing code style (ruff + black) and include tests for new functionality.
300
+
287
301
  ## License
288
302
 
289
303
  MIT © Sankalp Tharu
304
+
305
+ ---
306
+
307
+ *© 2024 Sankalp Tharu. All rights reserved.*
@@ -0,0 +1,274 @@
1
+ # djinit
2
+
3
+ <div align="center">
4
+
5
+ > PyPI didn't allow the original name, so you'll find it as **djinitx** on PyPI
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-4.2%20%7C%205.1%20%7C%205.2-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
+ **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.
15
+
16
+ ## Why djinit?
17
+
18
+ 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.
19
+
20
+ ## Installation
21
+
22
+ **Recommended** (using pipx):
23
+
24
+ ```bash
25
+ pipx install djinitx
26
+ ```
27
+
28
+ Or with pip:
29
+
30
+ ```bash
31
+ pip install djinitx
32
+ ```
33
+
34
+ Or with uv:
35
+
36
+ ```bash
37
+ uv tool install djinitx
38
+ ```
39
+
40
+ **Requirements**: Python 3.13+
41
+
42
+ ## Getting Started
43
+
44
+ ```bash
45
+ djinit setup
46
+ ```
47
+
48
+ or the shorter alias:
49
+
50
+ ```bash
51
+ dj setup
52
+ ```
53
+
54
+ The wizard will ask you a few questions:
55
+
56
+ 1. **What structure do you want?**
57
+ - **Standard** – Classic Django layout with split settings
58
+ - **Predefined** – Organized with `apps/` and `api/` folders (great for larger projects)
59
+ - **Unified** – Everything under `core/` and `apps/` (clean and minimal)
60
+ - **Single Folder** – All apps in one configurable folder (simple and flat)
61
+
62
+ 2. **Project Setup** – Destination directory (use `.` for current) and project name.
63
+
64
+ 3. **Database Configuration** – Choose `DATABASE_URL` (recommended) or individual variables; pick PostgreSQL or MySQL.
65
+
66
+ 4. **Django Apps** *(Standard structure only)* – Whether to create an `apps/` folder and which apps to scaffold.
67
+
68
+ 5. **CI/CD Pipeline** – GitHub Actions, GitLab CI, both, or skip it.
69
+
70
+ That’s it—your project will be ready with everything configured.
71
+
72
+ ## What You Get
73
+
74
+ - **Split settings** for development and production
75
+ - **Django REST Framework** with JWT authentication
76
+ - **API documentation** (Swagger UI at `/docs/`)
77
+ - **CORS** configured for local development
78
+ - **WhiteNoise** for static files
79
+ - **PostgreSQL** support (SQLite for dev)
80
+ - **Modern admin** interface (`django-jazzmin`)
81
+ - **Deployment ready** with `Procfile` and `runtime.txt`
82
+ - **Development tools** (`Justfile` with common commands)
83
+ - **Environment template** (`.env.sample`)
84
+ - **Git ready** (`.gitignore` included)
85
+
86
+ ## Commands
87
+
88
+ ### Create a Project
89
+
90
+ ```bash
91
+ djinit setup
92
+ ```
93
+
94
+ ### Add Apps to an Existing Project
95
+
96
+ ```bash
97
+ djinit app users products orders
98
+ ```
99
+
100
+ Creates the apps, adds them to `INSTALLED_APPS`, and wires up URLs.
101
+
102
+ ### Generate Secret Keys
103
+
104
+ ```bash
105
+ djinit secret
106
+ ```
107
+
108
+ Use `--count 5` to generate five keys or `--length 64` to change the length.
109
+
110
+ ## Project Structures
111
+
112
+ ### Standard Structure
113
+
114
+ ```
115
+ myproject/
116
+ ├── manage.py
117
+ ├── myproject/ # Config module
118
+ │ ├── settings/ # Split settings
119
+ │ ├── urls.py
120
+ │ └── wsgi.py
121
+ └── apps/ # Your apps (optional)
122
+ └── users/
123
+ ```
124
+
125
+ ### Single Folder Layout
126
+
127
+ ```
128
+ myproject/
129
+ ├── manage.py
130
+ ├── project/ # Configurable folder name
131
+ │ ├── settings/
132
+ │ ├── urls.py
133
+ │ ├── models/ # All models here
134
+ │ ├── api/ # API views & serializers
135
+ │ │ └── your_model_name/
136
+ │ │ ├── views.py
137
+ │ │ ├── serializers.py
138
+ │ │ └── urls.py
139
+ │ └── wsgi.py
140
+ ```
141
+
142
+ ### Predefined Structure
143
+
144
+ ```
145
+ myproject/
146
+ ├── manage.py
147
+ ├── config/ # Django config
148
+ │ ├── settings/
149
+ │ └── urls.py
150
+ ├── apps/ # Business logic
151
+ │ ├── users/
152
+ │ └── core/
153
+ └── api/ # API routes
154
+ └── v1/
155
+ ```
156
+
157
+ ### Unified Structure
158
+
159
+ ```
160
+ myproject/
161
+ ├── manage.py
162
+ ├── core/ # Django config
163
+ │ ├── settings/
164
+ │ └── urls.py
165
+ └── apps/ # Main application package
166
+ ├── admin/
167
+ ├── models/
168
+ ├── serializers/
169
+ ├── views/
170
+ ├── urls/
171
+ └── api/ # API routes
172
+ ```
173
+
174
+ ## Development Workflow
175
+
176
+ Your project ships with a `Justfile` for common tasks:
177
+
178
+ ```bash
179
+ just dev # Start dev server
180
+ just migrate # Run migrations
181
+ just makemigrations # Create migrations
182
+ just shell # Django shell
183
+ just test # Run tests
184
+ just format # Format code
185
+ just lint # Lint code
186
+ ```
187
+
188
+ If you don’t have `just` installed, these are just shortcuts for the equivalent Django commands.
189
+
190
+ ## What's Included
191
+
192
+ ### Packages
193
+
194
+ - **Django** – Web framework
195
+ - **Django REST Framework** – API toolkit
196
+ - **djangorestframework‑simplejwt** – JWT authentication
197
+ - **drf‑spectacular** – OpenAPI/Swagger docs
198
+ - **django‑cors‑headers** – CORS handling
199
+ - **django‑jazzmin** – Modern admin UI
200
+ - **whitenoise** – Static file serving
201
+ - **psycopg2‑binary** – PostgreSQL driver
202
+ - **gunicorn** – Production WSGI server
203
+ - **python‑dotenv** – `.env` handling
204
+
205
+ ### API Endpoints
206
+
207
+ | Endpoint | Description |
208
+ |-------------------|---------------------------------|
209
+ | `/admin/` | Django admin |
210
+ | `/token/` | Obtain JWT token |
211
+ | `/token/refresh/` | Refresh JWT token |
212
+ | `/docs/` | Swagger UI (dev only) |
213
+ | `/schema/` | OpenAPI schema (dev only) |
214
+
215
+ ### Settings Overview
216
+
217
+ - **Development** – SQLite, `DEBUG=True`, console email backend, permissive CORS.
218
+ - **Production** – PostgreSQL, hardened security settings, SMTP email backend, strict CORS.
219
+
220
+ ## Environment Setup
221
+
222
+ Copy the sample file and fill in your values:
223
+
224
+ ```bash
225
+ cp .env.sample .env
226
+ ```
227
+
228
+ ```dotenv
229
+ SECRET_KEY=your-secret-key-here # Generate with: djinit secret
230
+ DATABASE_URL=postgres://user:pass@host:5432/db
231
+ ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
232
+ ```
233
+
234
+ SQLite works out of the box for development—no extra DB setup required.
235
+
236
+ ## Roadmap
237
+
238
+ The following items are tracked in **TODO.md** and represent the near‑future direction of djinit.
239
+
240
+ ### Planned Features
241
+ - **Docker Support** – Auto‑generate a `Dockerfile` for containerized deployments.
242
+ - **Frontend Integration** – Scaffold React, Vue, or HTMX alongside the Django backend.
243
+ - **Celery Integration** – Simplify background task setup with Celery.
244
+ - **More Packages** – Add optional integrations for popular Django packages.
245
+
246
+ ### Enhancements
247
+ - **Add more project structure templates** – Expand the set of ready‑made layouts.
248
+ - **Add testing framework setup** – Provide pytest and coverage configuration out of the box.
249
+ - **Fix bugs** – Ongoing maintenance and bug resolution.
250
+
251
+ ### Completed
252
+ - **Interactive configuration wizard** – Streamlined project creation experience.
253
+ - **Improved structure detection** – Smarter detection of existing Django layouts.
254
+
255
+ > Contributions that address any of the above items are highly welcome!
256
+
257
+ ## Contributing
258
+
259
+ Found a bug or have an idea? Open an issue or submit a pull request. Contributions are always welcome!
260
+
261
+ 1. Fork the repository.
262
+ 2. Create a feature branch (`git checkout -b feature/awesome-feature`).
263
+ 3. Make your changes and ensure tests pass (`just test`).
264
+ 4. Submit a pull request with a clear description of the change.
265
+
266
+ Please follow the existing code style (ruff + black) and include tests for new functionality.
267
+
268
+ ## License
269
+
270
+ MIT © Sankalp Tharu
271
+
272
+ ---
273
+
274
+ *© 2024 Sankalp Tharu. All rights reserved.*
@@ -13,3 +13,4 @@
13
13
  - [x] Add interactive configuration wizard
14
14
  - [ ] Add testing framework setup (pytest, coverage)
15
15
  - [x] Improve structure detection
16
+ - [ ] Fix bugs
@@ -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.2"
10
+ version = "0.3.4"
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.generator:main"
60
- dj = "djinit.generator:main"
59
+ djinit = "djinit.cli:app"
60
+ dj = "djinit.cli:app"
61
61
 
62
62
  [dependency-groups]
63
63
  dev = [
@@ -0,0 +1,5 @@
1
+ questionary==2.1.1
2
+ rich==15.0.0
3
+ # dev
4
+ ruff==0.15.11
5
+ pre-commit==4.5.1
@@ -2,6 +2,7 @@
2
2
 
3
3
  line-length = 120
4
4
  target-version = "py38"
5
+ exclude = ["django-new"]
5
6
 
6
7
  [lint]
7
8
  select = [