36 Commits
Author SHA1 Message Date
sankalp d6fa789804 chore(root): bump versioin to 0.3.7 2026-09-11 14:32:15 +05:45
sankalp 8b48a9b9bb feat(templates): upgrade to Django 6.1 and MAILERS
Require django>=6.1 in pyproject, bump ruff/pytest/pytest-django,
point docs at 6.1, drop removed SECURE_BROWSER_XSS_FILTER and
STATICFILES_STORAGE settings. Replace deprecated EMAIL_* settings
with the Django 6.1 MAILERS dict.
2026-09-10 22:33:08 +05:45
sankalp 9793da4dbf refactor(templates/project): simplify manage.py env loading
Load .env once at top via BASE_DIR, drop duplicate environ setup in __main__.
2026-09-10 22:12:46 +05:45
sankalp 9b6edfec0e fix(templates/project): use project_name in pyproject.toml
Package name, ruff known-first-party, and settings per-file-ignores
now use project_name. package_name/module_name resolved to backend or
config/core, producing wrong import resolution and settings paths.
2026-09-10 22:12:45 +05:45
dependabot[bot] dfcd598da3 chore(deps): bump ruff from 0.16.5 to 0.16.6 (#67)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.5 to 0.16.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.16.5...0.16.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-07 02:25:22 +00:00
dependabot[bot] d64ca9ddb2 chore(deps): bump ruff from 0.16.4 to 0.16.5 (#66)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.4 to 0.16.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.16.4...0.16.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-31 02:25:43 +00:00
dependabot[bot] 3e6cb2f055 chore(deps): bump ruff from 0.16.3 to 0.16.4 (#65)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.3 to 0.16.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.16.3...0.16.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 02:24:37 +00:00
dependabot[bot] 5ce5ebbb09 chore(deps): bump ruff from 0.16.1 to 0.16.3 (#64)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.1 to 0.16.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.16.1...0.16.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-17 02:26:54 +00:00
dependabot[bot] ca79f1968e chore(deps): bump pre-commit from 4.6.1 to 4.6.2 (#63)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.6.1...v4.6.2)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-version: 4.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-17 02:24:31 +00:00
dependabot[bot] ca077e380c chore(deps): bump ruff from 0.16.0 to 0.16.1 (#62)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.0 to 0.16.1.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.16.0...0.16.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-03 02:24:55 +00:00
dependabot[bot] 44299ed8a9 chore(deps): bump pre-commit from 4.6.0 to 4.6.1 (#61)
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-version: 4.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-27 02:27:07 +00:00
dependabot[bot] 916d97ffdf chore(deps): bump ruff from 0.15.22 to 0.16.0 (#60)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.22 to 0.16.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.22...0.16.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-27 02:24:41 +00:00
dependabot[bot] 66927b988a chore(deps): bump actions/setup-python from 6 to 7 (#59)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-27 02:24:16 +00:00
dependabot[bot] df68383b44 chore(deps): bump ruff from 0.15.21 to 0.15.22 (#58)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.21 to 0.15.22.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.21...0.15.22)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-20 03:08:33 +00:00
dependabot[bot] d3066a7ceb chore(deps): bump ruff from 0.15.20 to 0.15.21 (#57)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.20 to 0.15.21.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.20...0.15.21)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-13 02:24:49 +00:00
sankalp 72e6b0df0f feat: remove AGENTS.md from .gitignore 2026-07-08 16:03:43 +05:45
dependabot[bot] 7b8d6f3342 chore(deps): bump ruff from 0.15.18 to 0.15.20 (#56)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.18 to 0.15.20.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.18...0.15.20)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-29 02:24:30 +00:00
sankalp fe9eec70d5 chore(root): bump version to 0.3.6
Release 0.3.6 with updated version number.
2026-06-25 14:47:52 +05:45
sankalp ad09fa0b79 refactor(src/djinit/templates/project): adjust env_path to parent instead of parent.parent
Simplify path resolution and avoid unnecessary filesystem traversal.
2026-06-25 12:26:01 +05:45
sankalp 5984961878 fix(src/djinit/templates/config/settings): fix .env path resolution
Prevent loading .env from wrong directory when project depth varies.
2026-06-25 12:25:44 +05:45
sankalp 5b755b789c feat(src/djinit/utils): add use_tailwind flag to project metadata
Include use_tailwind setting in generated context
2026-06-25 12:16:33 +05:45
sankalp 382d2a0f56 feat(src/djinit/templates/project): load .env and use env for settings module
Replace hard‑coded settings module with environment variable and load .env configuration for smoother local development.
2026-06-25 12:16:09 +05:45
sankalp c38d4b3832 feat(src/djinit/templates/config): add tailwind live‑reload support
Prevents missing media serving and enables dev tailwind reload
2026-06-25 12:15:52 +05:45
sankalp 3200c9f9b2 feat(src/djinit/creators): add use_tailwind context for Tailwind‑enabled scaffolding
Enable conditional Tailwind inclusion in generated files based on metadata.
2026-06-25 12:15:33 +05:45
sankalp fafe29c2cb Merge branch 'main' of github.com:S4NKALP/djinit 2026-06-24 00:45:04 +05:45
sankalp 9e3f5ead8f chore(root): update project metadata and lock file
Updated version to 0.3.5, refined description, and refreshed uv.lock with new dependency list.
2026-06-24 00:42:25 +05:45
sankalp 260d41b10d feat(src/djinit/templates/config/settings): resolve env_path for settings base
Resolve env_path to correctly load .env file from project root.
2026-06-24 00:42:08 +05:45
sankalp 2d7d712ecf feat(src/djinit/templates/config): add pathlib import and explicit .env path handling
Prevents issues with mischaracterized .env locations and ensures deterministic environment loading.
2026-06-24 00:41:51 +05:45
dependabot[bot] 3ffd85d2ca chore(deps): bump ruff from 0.15.17 to 0.15.18 (#55)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.17 to 0.15.18.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.17...0.15.18)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 02:24:23 +00:00
dependabot[bot] 8c1195880d chore(deps): bump actions/checkout from 6 to 7 (#54)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 02:24:04 +00:00
sankalp c1262d02e9 Merge branch 'main' of github.com:S4NKALP/djinit 2026-06-16 15:44:10 +05:45
sankalp 63989b7f67 chore(.github/workflows): switch dependabot auto-merge target to squash
Update auto-merge configuration to use squash strategy instead of minor for cleaner merge commits.
2026-06-16 15:43:48 +05:45
sankalp b3b0c660e6 Merge pull request #53 from S4NKALP/dependabot/pip/main/ruff-0.15.17
chore(deps): bump ruff from 0.15.16 to 0.15.17
2026-06-15 08:15:14 +05:45
dependabot[bot] 3de5d577a1 chore(deps): bump ruff from 0.15.16 to 0.15.17
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.16 to 0.15.17.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.16...0.15.17)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-15 02:24:15 +00:00
sankalp e5f93e829b Merge pull request #52 from S4NKALP/dependabot/pip/main/ruff-0.15.16
chore(deps): bump ruff from 0.15.14 to 0.15.16
2026-06-08 11:12:07 +05:45
dependabot[bot] ce5cda9330 chore(deps): bump ruff from 0.15.14 to 0.15.16
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.14 to 0.15.16.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.15.14...0.15.16)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-08 05:21:46 +00:00
20 changed files with 98 additions and 50 deletions

No files matched your search

+2 -2
View File
@@ -16,10 +16,10 @@ jobs:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
+1 -1
View File
@@ -19,4 +19,4 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
use-github-auto-merge: true
target: minor
target: squash
+2 -2
View File
@@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: "3.13"
+2 -2
View File
@@ -11,9 +11,9 @@ jobs:
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: '3.12'
cache: 'pip'
-2
View File
@@ -1,8 +1,6 @@
#--------------------------------------------------#
# The following was generated by djinit: #
#--------------------------------------------------#
AGENTS.md
# Python
*.py[cod]
*$py.class
+1 -1
View File
@@ -7,7 +7,7 @@ packages = ["src/djinit"]
[project]
name = "djinitx"
version = "0.3.5"
version = "0.3.7"
description = "A CLI tool to setup Django project"
readme = "README.md"
requires-python = ">=3.10"
+2 -2
View File
@@ -1,5 +1,5 @@
questionary==2.1.1
rich==15.0.0
# dev
ruff==0.15.14
pre-commit==4.6.0
ruff==0.16.6
pre-commit==4.6.2
+1 -1
View File
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
setup(
name="djinitx",
version="0.3.5",
version="0.3.7",
description="A CLI tool to setup Django projects",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
+9 -1
View File
@@ -122,6 +122,7 @@ class FileCreator(BaseService):
"project_name": self.project_name,
"api_module": api_module,
"include_api": True,
"use_tailwind": self.metadata.get("use_tailwind", False),
}
if comment_out_api:
urls_context["comment_out_api_url"] = True
@@ -247,6 +248,7 @@ class FileCreator(BaseService):
"app_names": effective_app_modules,
"include_apps": True,
"include_api": True,
"use_tailwind": self.metadata.get("use_tailwind", False),
}
self._render_and_create_file(
"urls.py",
@@ -308,7 +310,13 @@ class FileCreator(BaseService):
CommonUtils.create_file_from_template(
project_urls_path,
"config/urls.py-tpl",
{"url_type": "project", "project_name": self.project_name, "api_module": "api", "include_api": True},
{
"url_type": "project",
"project_name": self.project_name,
"api_module": "api",
"include_api": True,
"use_tailwind": self.metadata.get("use_tailwind", False),
},
"Updated project urls.py to include API routes",
should_format=True,
)
+3 -1
View File
@@ -1,11 +1,13 @@
"""generated with djinit"""
import os
from pathlib import Path
import environ
from django.core.asgi import get_asgi_application
env_path = Path(__file__).resolve().parent.parent / ".env"
env = environ.Env()
environ.Env.read_env()
environ.Env.read_env(env_path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", env("DJANGO_SETTINGS_MODULE", default="[[ project_name ]].settings.production"))
application = get_asgi_application()
@@ -9,14 +9,15 @@ from pathlib import Path
import environ
env_path = Path(__file__).resolve().parent.parent.parent / ".env"
env = environ.Env()
environ.Env.read_env()
environ.Env.read_env(env_path)
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
# Application definition
@@ -82,7 +83,7 @@ WSGI_APPLICATION = "[[ project_name ]].wsgi.application"
# Password validation
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/6.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
@@ -101,7 +102,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/5.2/topics/i18n/
# https://docs.djangoproject.com/en/6.1/topics/i18n/
LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
@@ -175,7 +176,6 @@ CORS_ALLOW_HEADERS = [
CORS_PREFLIGHT_MAX_AGE = 86400 # 24 hours
# Security Settings
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
X_FRAME_OPTIONS = "DENY"
@@ -10,7 +10,7 @@ DEBUG = True
ALLOWED_HOSTS = ["*"]
# Database
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
DATABASES = {
"default": {
@@ -30,8 +30,12 @@ DATABASES = {
}
}
# Email backend for development
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Email settings for development
MAILERS = {
"default": {
"BACKEND": "django.core.mail.backends.console.EmailBackend",
},
}
# CORS settings for development
# Allow all origins in development (convenient but not secure)
@@ -43,14 +43,20 @@ CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_PRIVATE_NETWORK = False
# Email settings
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = env('EMAIL_HOST', default="smtp.gmail.com")
EMAIL_PORT = env.int('EMAIL_PORT', default=587)
EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', default=True)
EMAIL_HOST_USER = env('EMAIL_HOST_USER', default="")
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD', default="")
DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER', default="")
SERVER_EMAIL = env('EMAIL_HOST_USER', default="")
MAILERS = {
'default': {
'BACKEND': 'django.core.mail.backends.smtp.EmailBackend',
'OPTIONS': {
'host': env('EMAIL_HOST', default='smtp.gmail.com'),
'port': env.int('EMAIL_PORT', default=587),
'use_tls': env.bool('EMAIL_USE_TLS', default=True),
'username': env('EMAIL_HOST_USER', default=''),
'password': env('EMAIL_HOST_PASSWORD', default=''),
},
},
}
DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER', default='')
SERVER_EMAIL = env('EMAIL_HOST_USER', default='')
# Security settings for production
SECURE_SSL_REDIRECT = True
@@ -63,9 +69,6 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# Static files
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# @IF use_tailwind
## Tailwind
TAILWIND_CLI_VERSION = "4.1.3" # Pin version
+19 -2
View File
@@ -2,12 +2,13 @@
"""generated with djinit"""
from django.contrib import admin
from django.urls import path
from django.urls import path, re_path
from django.conf import settings
from django.views.static import serve
# @IF include_api or include_apps
from django.urls import include
# @ENDIF
# @IF include_api
from django.conf import settings
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from rest_framework_simplejwt.views import (
@@ -54,6 +55,22 @@ if settings.DEBUG:
path("schema/", schema_view.with_ui("redoc", cache_timeout=0)),
]
# @ENDIF
# @IF use_tailwind
# django-browser-reload for tailwind live reload (dev only)
if settings.DEBUG:
urlpatterns += [
path("__reload__/", include("django_browser_reload.urls")),
]
# @ENDIF
urlpatterns += [
re_path(
r"^media/(?P<path>.*)$",
serve,
{"document_root": settings.MEDIA_ROOT},
),
]
# @ENDIF
# @IF url_type == 'api_root'
from django.urls import include, path
+3 -1
View File
@@ -1,11 +1,13 @@
"""generated with djinit"""
import os
from pathlib import Path
import environ
from django.core.wsgi import get_wsgi_application
env_path = Path(__file__).resolve().parent.parent / ".env"
env = environ.Env()
environ.Env.read_env()
environ.Env.read_env(env_path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", env("DJANGO_SETTINGS_MODULE", default="[[ project_name ]].settings.production"))
+15 -5
View File
@@ -3,15 +3,28 @@
"""generated with djinit"""
"""Django's command-line utility for administrative tasks."""
import os
import sys
from pathlib import Path
import environ
# Load environment variables from .env
BASE_DIR = Path(__file__).resolve().parent
env = environ.Env()
env.read_env(BASE_DIR / ".env")
def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.getenv("DJANGO_SETTINGS_MODULE", "[[ project_name ]].settings.production"))
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
env(
"DJANGO_SETTINGS_MODULE",
default="[[ project_name ]].settings.production",
),
)
try:
from django.core.management import execute_from_command_line
@@ -21,12 +34,9 @@ def main():
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == "__main__":
env = environ.Env()
# Read .env file, if it exists
environ.Env.read_env()
main()
@@ -1,12 +1,12 @@
[project]
name = "[[ package_name ]]"
name = "[[ project_name ]]"
version = "0.1.0"
description = ""
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
dependencies = [
"django",
"django>=6.1,<7.0",
"django-environ",
"django-jazzmin",
"djangorestframework",
@@ -37,9 +37,9 @@ dependencies = [
[dependency-groups]
dev = [
"ruff>=0.14.2",
"pytest>=8.0.0",
"pytest-django>=4.9.0",
"ruff>=0.16.6",
"pytest>=9.1.1",
"pytest-django>=4.14.0",
]
[tool.ruff]
@@ -62,4 +62,7 @@ ignore = [
]
[tool.ruff.lint.isort]
known-first-party = ["[[ module_name ]]"]
known-first-party = ["[[ project_name ]]"]
[tool.ruff.lint.per-file-ignores]
"[[ project_name ]]/settings/*.py" = ["F403", "F405"]
+1
View File
@@ -65,6 +65,7 @@ class DjangoHelper:
"url_type": "project",
"project_name": project_name,
"django_version": DjangoHelper.DJANGO_VERSION,
"use_tailwind": metadata.get("use_tailwind", False),
}
project_files = [
("urls.py", "config/urls.py-tpl", urls_context),
Generated
+1 -1
View File
@@ -43,7 +43,7 @@ wheels = [
[[package]]
name = "djinitx"
version = "0.3.4"
version = "0.3.7"
source = { editable = "." }
dependencies = [
{ name = "questionary" },