djinitx 0.2.0__tar.gz → 0.3.0__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 (110) hide show
  1. djinitx-0.3.0/.github/dependabot.yml +16 -0
  2. djinitx-0.3.0/.github/workflows/ci.yml +46 -0
  3. djinitx-0.3.0/.github/workflows/codeql.yml +33 -0
  4. djinitx-0.3.0/.github/workflows/dependabot-auto-merge.yml +35 -0
  5. djinitx-0.3.0/.github/workflows/pre-commit.yml +29 -0
  6. djinitx-0.3.0/.github/workflows/publish.yml +27 -0
  7. djinitx-0.3.0/.pre-commit-config.yaml +20 -0
  8. djinitx-0.3.0/.python-version +1 -0
  9. djinitx-0.3.0/PKG-INFO +291 -0
  10. djinitx-0.3.0/README.md +256 -0
  11. djinitx-0.3.0/TODO.md +14 -0
  12. {djinitx-0.2.0 → djinitx-0.3.0}/djinit/cli.py +28 -43
  13. djinitx-0.2.0/djinit/scripts/command_handler.py → djinitx-0.3.0/djinit/commands/handler.py +4 -12
  14. djinitx-0.3.0/djinit/core/config.py +14 -0
  15. djinitx-0.3.0/djinit/core/types.py +48 -0
  16. {djinitx-0.2.0 → djinitx-0.3.0}/djinit/generator.py +5 -10
  17. djinitx-0.2.0/djinit/scripts/app_generator.py → djinitx-0.3.0/djinit/services/app.py +36 -29
  18. djinitx-0.3.0/djinit/services/files.py +397 -0
  19. {djinitx-0.2.0/djinit/scripts → djinitx-0.3.0/djinit/services}/project.py +46 -35
  20. djinitx-0.2.0/djinit/scripts/template_engine.py → djinitx-0.3.0/djinit/services/templates.py +1 -0
  21. djinitx-0.3.0/djinit/templates/components/api_readme.j2 +76 -0
  22. djinitx-0.3.0/djinit/templates/components/migrations_init.j2 +0 -0
  23. djinitx-0.3.0/djinit/templates/components/models_readme.j2 +119 -0
  24. djinitx-0.3.0/djinit/templates/config/asgi.j2 +11 -0
  25. {djinitx-0.2.0/djinit/templates/project → djinitx-0.3.0/djinit/templates/config}/settings/base.j2 +22 -6
  26. {djinitx-0.2.0/djinit/templates/project → djinitx-0.3.0/djinit/templates/config}/settings/development.j2 +13 -0
  27. djinitx-0.3.0/djinit/templates/config/settings/production.j2 +65 -0
  28. djinitx-0.2.0/djinit/templates/project/urls_with_api.j2 → djinitx-0.3.0/djinit/templates/config/urls/with_api.j2 +2 -1
  29. djinitx-0.2.0/djinit/templates/project/urls_with_apps.j2 → djinitx-0.3.0/djinit/templates/config/urls/with_apps.j2 +1 -1
  30. djinitx-0.3.0/djinit/templates/config/wsgi.j2 +12 -0
  31. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/env_sample.j2 +8 -1
  32. djinitx-0.3.0/djinit/templates/project/gitignore.j2 +93 -0
  33. djinitx-0.3.0/djinit/templates/project/init.j2 +0 -0
  34. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/manage_py.j2 +5 -2
  35. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/pyproject_toml.j2 +2 -1
  36. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/readme.j2 +73 -28
  37. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/requirements.j2 +6 -2
  38. djinitx-0.3.0/djinit/ui/__init__.py +0 -0
  39. djinitx-0.3.0/djinit/ui/console.py +197 -0
  40. djinitx-0.2.0/djinit/scripts/input_handler.py → djinitx-0.3.0/djinit/ui/input.py +137 -121
  41. djinitx-0.3.0/djinit/utils/__init__.py +0 -0
  42. djinitx-0.2.0/djinit/utils.py → djinitx-0.3.0/djinit/utils/common.py +19 -31
  43. djinitx-0.2.0/djinit/scripts/django_helper.py → djinitx-0.3.0/djinit/utils/django.py +27 -39
  44. djinitx-0.3.0/djinit/utils/exceptions.py +30 -0
  45. djinitx-0.2.0/djinit/scripts/secretkey_generator.py → djinitx-0.3.0/djinit/utils/security.py +1 -1
  46. djinitx-0.2.0/djinit/scripts/name_validator.py → djinitx-0.3.0/djinit/utils/validators.py +1 -6
  47. {djinitx-0.2.0 → djinitx-0.3.0}/pyproject.toml +9 -1
  48. djinitx-0.3.0/requirements.txt +4 -0
  49. djinitx-0.3.0/ruff.toml +27 -0
  50. {djinitx-0.2.0 → djinitx-0.3.0}/setup.py +1 -1
  51. djinitx-0.3.0/uv.lock +298 -0
  52. djinitx-0.2.0/PKG-INFO +0 -444
  53. djinitx-0.2.0/README.md +0 -404
  54. djinitx-0.2.0/djinit/scripts/console_ui.py +0 -391
  55. djinitx-0.2.0/djinit/scripts/files.py +0 -344
  56. djinitx-0.2.0/djinit/templates/project/asgi.j2 +0 -11
  57. djinitx-0.2.0/djinit/templates/project/settings/production.j2 +0 -55
  58. djinitx-0.2.0/djinit/templates/project/wsgi.j2 +0 -11
  59. djinitx-0.2.0/djinitx.egg-info/PKG-INFO +0 -444
  60. djinitx-0.2.0/djinitx.egg-info/SOURCES.txt +0 -79
  61. djinitx-0.2.0/djinitx.egg-info/dependency_links.txt +0 -1
  62. djinitx-0.2.0/djinitx.egg-info/entry_points.txt +0 -3
  63. djinitx-0.2.0/djinitx.egg-info/requires.txt +0 -4
  64. djinitx-0.2.0/djinitx.egg-info/top_level.txt +0 -1
  65. djinitx-0.2.0/setup.cfg +0 -4
  66. /djinitx-0.2.0/djinit/templates/shared/gitignore.j2 → /djinitx-0.3.0/.gitignore +0 -0
  67. {djinitx-0.2.0 → djinitx-0.3.0}/LICENSE +0 -0
  68. {djinitx-0.2.0 → djinitx-0.3.0}/MANIFEST.in +0 -0
  69. {djinitx-0.2.0 → djinitx-0.3.0}/djinit/__init__.py +0 -0
  70. {djinitx-0.2.0/djinit/scripts → djinitx-0.3.0/djinit/commands}/__init__.py +0 -0
  71. /djinitx-0.2.0/djinit/templates/base/migrations_init.j2 → /djinitx-0.3.0/djinit/core/__init__.py +0 -0
  72. /djinitx-0.2.0/djinit/templates/shared/init.j2 → /djinitx-0.3.0/djinit/services/__init__.py +0 -0
  73. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/admin.j2 +0 -0
  74. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/apps.j2 +0 -0
  75. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/models.j2 +0 -0
  76. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/routes.j2 +0 -0
  77. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/serializers.j2 +0 -0
  78. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/tests.j2 +0 -0
  79. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/urls.j2 +0 -0
  80. {djinitx-0.2.0/djinit/templates/base → djinitx-0.3.0/djinit/templates/components}/views.j2 +0 -0
  81. /djinitx-0.2.0/djinit/templates/project/urls.j2 → /djinitx-0.3.0/djinit/templates/config/urls/base.j2 +0 -0
  82. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/api/urls.j2 +0 -0
  83. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/api/v1/urls.j2 +0 -0
  84. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/models.j2 +0 -0
  85. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/serializers.j2 +0 -0
  86. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/services.j2 +0 -0
  87. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/tests.j2 +0 -0
  88. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/urls.j2 +0 -0
  89. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/generic/views.j2 +0 -0
  90. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/models.j2 +0 -0
  91. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/serializers.j2 +0 -0
  92. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/services.j2 +0 -0
  93. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/tests.j2 +0 -0
  94. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/urls.j2 +0 -0
  95. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/apps/users/views.j2 +0 -0
  96. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/core/exceptions.j2 +0 -0
  97. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/core/middleware/request_logger.j2 +0 -0
  98. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/core/mixins/timestamped_model.j2 +0 -0
  99. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/predefined/core/utils/responses.j2 +0 -0
  100. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/apps.j2 +0 -0
  101. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/models/__init__.py.j2 +0 -0
  102. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/models/base.py.j2 +0 -0
  103. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/models/mixins.py.j2 +0 -0
  104. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/utils/__init__.py.j2 +0 -0
  105. {djinitx-0.2.0/djinit/templates → djinitx-0.3.0/djinit/templates/presets}/unified/apps/core/utils/responses.py.j2 +0 -0
  106. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/ci/github_actions.j2 +0 -0
  107. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/ci/gitlab_ci.j2 +0 -0
  108. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/justfile.j2 +0 -0
  109. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/procfile.j2 +0 -0
  110. {djinitx-0.2.0/djinit/templates/shared → djinitx-0.3.0/djinit/templates/project}/runtime_txt.j2 +0 -0
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ target-branch: "main"
8
+ rebase-strategy: "auto"
9
+
10
+ - package-ecosystem: "pip"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ target-branch: "main"
15
+ rebase-strategy: "auto"
16
+ open-pull-requests-limit: 10
@@ -0,0 +1,46 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ name: Lint and Test
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v6
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install ruff
30
+ pip install -e .
31
+
32
+ - name: Lint with Ruff
33
+ run: |
34
+ ruff check djinit/
35
+
36
+ - name: Check formatting with Ruff
37
+ run: |
38
+ ruff format --check djinit/
39
+
40
+ - name: Test CLI import
41
+ run: |
42
+ python -c "from djinit.generator import main; print('Import successful')"
43
+
44
+ - name: Test console script entry point
45
+ run: |
46
+ djinit --help
@@ -0,0 +1,33 @@
1
+ name: CodeQL Analysis
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ schedule:
9
+ - cron: '0 0 * * 1' # Weekly on Monday
10
+
11
+ jobs:
12
+ analyze:
13
+ name: CodeQL Security Analysis
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ actions: read
17
+ contents: read
18
+ security-events: write
19
+
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@v6
23
+
24
+ - name: Initialize CodeQL
25
+ uses: github/codeql-action/init@v4
26
+ with:
27
+ languages: python
28
+
29
+ - name: Autobuild
30
+ uses: github/codeql-action/autobuild@v4
31
+
32
+ - name: Perform CodeQL Analysis
33
+ uses: github/codeql-action/analyze@v4
@@ -0,0 +1,35 @@
1
+ name: Dependabot Auto-Approve and Auto-Merge
2
+ on:
3
+ pull_request_target:
4
+ types: [opened, reopened, synchronize]
5
+ permissions:
6
+ contents: write
7
+ pull-requests: write
8
+ jobs:
9
+ dependabot:
10
+ if: github.actor == 'dependabot[bot]'
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Dependabot metadata
14
+ id: metadata
15
+ uses: dependabot/fetch-metadata@v2
16
+ - name: Approve PR
17
+ if: |
18
+ steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
19
+ steps.metadata.outputs.update-type == 'version-update:semver-patch'
20
+ uses: actions/github-script@v8
21
+ with:
22
+ script: |
23
+ await github.rest.pulls.createReview({
24
+ owner: context.repo.owner,
25
+ repo: context.repo.repo,
26
+ pull_number: context.payload.pull_request.number,
27
+ event: 'APPROVE'
28
+ })
29
+ - name: Enable auto-merge (squash)
30
+ if: |
31
+ steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
32
+ steps.metadata.outputs.update-type == 'version-update:semver-patch'
33
+ uses: peter-evans/enable-pull-request-automerge@v3
34
+ with:
35
+ merge-method: squash
@@ -0,0 +1,29 @@
1
+
2
+ name: Pre-commit
3
+
4
+ on:
5
+ pull_request:
6
+ push:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ pre-commit:
11
+ name: Run Pre-commit Hooks
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v6
19
+ with:
20
+ python-version: "3.13"
21
+
22
+ - name: Install pre-commit
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install pre-commit
26
+
27
+ - name: Run pre-commit
28
+ run: |
29
+ pre-commit run --all-files
@@ -0,0 +1,27 @@
1
+ name: Publish to PyPI
2
+ on:
3
+ release:
4
+ types: [published]
5
+ permissions:
6
+ contents: read
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ environment: release
11
+ permissions:
12
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v4
17
+ with:
18
+ python-version: '3.12'
19
+ cache: 'pip'
20
+ - name: Install dependencies
21
+ run: |
22
+ python -m pip install --upgrade pip
23
+ pip install build twine
24
+ - name: Build package
25
+ run: python -m build
26
+ - name: Publish package to PyPI
27
+ run: python -m twine upload dist/* --verbose
@@ -0,0 +1,20 @@
1
+ # Pre-commit hooks for djinit
2
+
3
+ default_language_version:
4
+ python: python3.13
5
+
6
+ repos:
7
+ - repo: https://github.com/astral-sh/ruff-pre-commit
8
+ rev: v0.1.4
9
+ hooks:
10
+ - id: ruff
11
+ args: [--fix, --exit-non-zero-on-fix]
12
+ - id: ruff-format
13
+
14
+ - repo: https://github.com/pre-commit/pre-commit-hooks
15
+ rev: v4.5.0
16
+ hooks:
17
+ - id: trailing-whitespace
18
+ - id: end-of-file-fixer
19
+ - id: check-yaml
20
+ - id: check-added-large-files
@@ -0,0 +1 @@
1
+ 3.13
djinitx-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,291 @@
1
+ Metadata-Version: 2.4
2
+ Name: djinitx
3
+ Version: 0.3.0
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.13
29
+ Requires-Dist: click>=8.3.0
30
+ Requires-Dist: jinja2>=3.1.0
31
+ Requires-Dist: pre-commit>=4.5.0
32
+ Requires-Dist: rich>=14.2.0
33
+ Requires-Dist: ruff>=0.14.2
34
+ Description-Content-Type: text/markdown
35
+
36
+ # djinit
37
+
38
+ <div align="center">
39
+
40
+ > PyPI didn't allow the original name, so you'll find it as **djinitx** on PyPI
41
+
42
+ <img src="https://img.shields.io/pypi/v/djinitx?color=blue&label=PyPI&logo=pypi&logoColor=white" alt="PyPI">
43
+ <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">
44
+ <img src="https://img.shields.io/badge/Python-3.13%2B-3776AB?logo=python&logoColor=white" alt="Python">
45
+ <a href="https://github.com/S4NKALP/djinit/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
46
+
47
+ </div>
48
+
49
+ **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.
50
+
51
+ ## Why djinit?
52
+
53
+ 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.
54
+
55
+ ## Installation
56
+
57
+ **Recommended** (using pipx):
58
+
59
+ ```bash
60
+ pipx install djinitx
61
+ ```
62
+
63
+ Or with pip:
64
+
65
+ ```bash
66
+ pip install djinitx
67
+ ```
68
+
69
+ Or with uv:
70
+
71
+ ```bash
72
+ uv tool install djinitx
73
+ ```
74
+
75
+ **Requirements**: Python 3.13+
76
+
77
+ ## Getting Started
78
+
79
+ Just run:
80
+
81
+ ```bash
82
+ djinit setup
83
+ ```
84
+
85
+ You can also use the shorter alias:
86
+
87
+ ```bash
88
+ dj setup
89
+ ```
90
+
91
+ The tool will ask you a few questions:
92
+
93
+ 1. **What structure do you want?**
94
+ - **Standard**: Classic Django layout with split settings
95
+ - **Predefined**: Organized with `apps/` and `api/` folders (great for larger projects)
96
+ - **Unified**: Everything under `core/` and `apps/` (clean and minimal)
97
+ - **Single Folder**: All apps in one configurable folder (simple and flat)
98
+
99
+ 2. **Project Setup**:
100
+ - Where to create it (use `.` for current directory)
101
+ - Project name (or directory name for Single Folder)
102
+
103
+ 3. **Database Configuration**:
104
+ - Use `DATABASE_URL` (cleaner, recommended)
105
+ - Or separate DB variables
106
+ - Choose between PostgreSQL or MySQL
107
+
108
+ 4. **Django Apps** (Standard Structure only):
109
+ - Whether to use an `apps/` folder
110
+ - Which apps to create
111
+
112
+ 5. **CI/CD Pipeline**:
113
+ - GitHub Actions, GitLab CI, both, or skip it
114
+
115
+ That's it! Your project will be ready with everything configured.
116
+
117
+ ## What You Get
118
+
119
+ Every project includes:
120
+
121
+ - **Split settings** for development and production
122
+ - **Django REST Framework** with JWT authentication
123
+ - **API documentation** (Swagger UI at `/docs/`)
124
+ - **CORS** configured for local development
125
+ - **WhiteNoise** for serving static files
126
+ - **PostgreSQL** support (SQLite for dev)
127
+ - **Modern admin** interface (django-jazzmin)
128
+ - **Deployment ready** with Procfile and runtime.txt
129
+ - **Development tools** (Justfile with common commands)
130
+ - **Environment template** (.env.sample)
131
+ - **Git ready** (.gitignore included)
132
+
133
+ ## Commands
134
+
135
+ ### Create a Project
136
+
137
+ ```bash
138
+ djinit setup
139
+ ```
140
+
141
+ ### Add Apps to Existing Project
142
+
143
+ ```bash
144
+ djinit app users products orders
145
+ ```
146
+
147
+ This automatically creates the apps, adds them to `INSTALLED_APPS`, and wires up URLs.
148
+
149
+ ### Generate Secret Keys
150
+
151
+ ```bash
152
+ djinit secret
153
+ ```
154
+
155
+ Need more? Use `--count 5` or change length with `--length 64`.
156
+
157
+ ## Project Structures
158
+
159
+ ### Standard Structure
160
+
161
+ The classic Django layout with split settings:
162
+
163
+ ```
164
+ myproject/
165
+ ├── manage.py
166
+ ├── myproject/ # Config module
167
+ │ ├── settings/ # Split settings
168
+ │ ├── urls.py
169
+ │ └── wsgi.py
170
+ └── apps/ # Your apps (optional)
171
+ └── users/
172
+ ```
173
+
174
+ ### Single Folder Layout
175
+
176
+ Simple structure with all apps in one folder:
177
+
178
+ ```
179
+ myproject/
180
+ ├── manage.py
181
+ ├── project/ # Configurable folder name
182
+ │ ├── settings/
183
+ │ ├── urls.py
184
+ │ ├── models/ # All models here
185
+ │ ├── api/ # API views and serializers
186
+ │ │ └── your_model_name/
187
+ │ │ ├── views.py
188
+ │ │ ├── serializers.py
189
+ │ │ └── urls.py
190
+ │ └── wsgi.py
191
+ ```
192
+
193
+ ### Predefined Structure
194
+
195
+ Organized for larger projects:
196
+
197
+ ```
198
+ myproject/
199
+ ├── manage.py
200
+ ├── config/ # Django config
201
+ │ ├── settings/
202
+ │ └── urls.py
203
+ ├── apps/ # Business logic
204
+ │ ├── users/
205
+ │ └── core/
206
+ └── api/ # API routes
207
+ └── v1/
208
+ ```
209
+
210
+ ### Unified Structure
211
+
212
+ Clean and minimal:
213
+
214
+ ```
215
+ myproject/
216
+ ├── manage.py
217
+ ├── core/ # Django config
218
+ │ ├── settings/
219
+ │ └── urls.py
220
+ └── apps/ # Main application package
221
+ ├── admin/
222
+ ├── models/
223
+ ├── serializers/
224
+ ├── views/
225
+ ├── urls/
226
+ └── api/ # API routes
227
+ ```
228
+
229
+ ## Development Workflow
230
+
231
+ Your project comes with a `Justfile` for common tasks:
232
+
233
+ ```bash
234
+ just dev # Start dev server
235
+ just migrate # Run migrations
236
+ just makemigrations # Create migrations
237
+ just shell # Django shell
238
+ just test # Run tests
239
+ just format # Format code
240
+ just lint # Lint code
241
+ ```
242
+
243
+ Don't have `just` installed? No problem—these are just shortcuts for standard Django commands.
244
+
245
+ ## What's Included
246
+
247
+ ### Packages
248
+
249
+ - Django (web framework)
250
+ - Django REST Framework (API)
251
+ - djangorestframework-simplejwt (JWT auth)
252
+ - drf-spectacular (API docs)
253
+ - django-cors-headers (CORS)
254
+ - django-jazzmin (modern admin)
255
+ - whitenoise (static files)
256
+ - psycopg2-binary (PostgreSQL)
257
+ - gunicorn (production server)
258
+ - python-dotenv (environment variables)
259
+
260
+ ### API Endpoints
261
+
262
+ - `/admin/` - Django admin
263
+ - `/token/` - Get JWT token
264
+ - `/token/refresh/` - Refresh token
265
+ - `/docs/` - Swagger UI (dev only)
266
+ - `/schema/` - OpenAPI schema (dev only)
267
+
268
+ ### Settings
269
+
270
+ **Development**: SQLite, debug mode, console emails, permissive CORS
271
+ **Production**: PostgreSQL, security hardened, SMTP emails, strict CORS
272
+
273
+ ## Environment Setup
274
+
275
+ Copy `.env.sample` to `.env` and fill in your values:
276
+
277
+ ```bash
278
+ SECRET_KEY=your-secret-key-here # Use: djinit secret
279
+ DATABASE_URL=postgres://user:pass@host:5432/db
280
+ ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
281
+ ```
282
+
283
+ For development, SQLite works out of the box—no database setup needed!
284
+
285
+ ## Contributing
286
+
287
+ Found a bug or have an idea? Open an issue or submit a pull request. Contributions are always welcome!
288
+
289
+ ## License
290
+
291
+ MIT © Sankalp Tharu