Commit Graph
59 Commits
Author SHA1 Message Date
sankalp 0cff748d5e feat(djinit/templates): Refine template placeholders for production and environment configuration files
Added conditional comment handling for database settings in production template, introduced DATABASE_URL generation in env_sample, and corrected readme structure rendering.

New Features
- Added conditional comment handling for `use_database_url` and `database_type` in production settings.
- Added `DATABASE_URL` template logic for MySQL and PostgreSQL in env_sample.
- Updated `readme.md` template to properly render unified_structure sections.

Enhancements
- Ensured comment syntax consistency across all template files.
- Streamlined placeholder usage for clearer project scaffolding.

Bug Fixes
- Removed stray formatting characters from comment markers.
2026-01-31 02:48:32 +05:45
sankalp 85981115ce refactor(djinit/utils): centralize utility functions into CommonUtils class
- Enhancements:
  - Moved file and directory creation helpers into CommonUtils class
  - Updated all call sites to use CommonUtils methods
  - Removed unused standalone utility functions and imports
  - Preserved existing behavior without functional changes
2026-01-31 02:48:26 +05:45
sankalp 744f65efc7 refactor(djinit/ui): use CommonUtils.get_package_name instead of get_package_name
- Refactor imports to use CommonUtils for resolving package names
- Update calls in `InputCollector` and `get_user_input` to use `CommonUtils.get_package_name`
- No functional change; improve code consistency and future extensibility
2026-01-31 02:48:21 +05:45
sankalp 995d0624e4 feat(djinit/commands): add dedicated commands for app creation and secret key generation
New Features
- Added `app.py` command to scaffold Django apps with name validation and post‑creation instructions.
- Added `secret.py` command to generate configurable secret keys and display usage guidance.

Enhancements
- Refactored command dispatch in `handler.py` to delegate to specialized command classes, removing duplicated logic.
- Improved modularity and maintainability of command implementation.
2026-01-31 02:48:18 +05:45
sankalp e5f05681d1 feat(djinit): introduce base service abstractions and refactor template engine
Add foundational class hierarchy and refactor the template engine to use inheritance and common utilities, enhancing extensibility and code organization.

- New Feature: Added BaseObject, BaseService, BaseCommand, and BaseUtils classes in djinit/core/base.py providing common interfaces.
- Enhancement: Refactored TemplateEngine to inherit BaseService and utilize BaseUtils for logic parsing.
- Enhancement: Updated InFileLogicParser to enforce proper stack handling and simplified conditional block processing.
- Enhancement: Consolidated utility functions via CommonUtils in generator and ProjectManager, streamlining app configuration upgrades.
2026-01-31 02:48:13 +05:45
sankalp 64edec1cc2 feat(djinit/core): bump Django version to 6.0.1
This update aligns generated projects with Django 6.0.1, providing access to the latest framework improvements and security patches.
2026-01-31 02:17:46 +05:45
sankalp f82bf1172d feat(djinit/services): support nested apps and full AppConfig path handling
- New Features
  - Detect and process nested project structures, generating correct module paths for AppConfig.
  - Automatically upgrade legacy app configurations from simple module paths to full AppConfig paths.
- Enhancements
  - Insert full AppConfig paths into USER_DEFINED_APPS, improving template rendering for all settings files.
  - Provide clearer success and upgrade messages to users.
- Bug Fixes
  - Avoid duplicate app entries and handle missing USER_DEFINED_APPS sections without crashing.
  - Ensure proper __init__.py creation in nested directories.
2026-01-31 02:15:50 +05:45
sankalp cab69c2232 feat(djinit/templates/components): expose configurable app_config_name placeholder in AppConfig template
Allows the generated AppConfig class to use a custom name derived from `app_config_name`, supporting optional `app_module` specification.

New Features
- Replace `app_name|title` placeholder with `app_config_name` for flexible config naming.
- Add conditional block that sets `name` to `app_module` when provided, otherwise falls back to `app_name`.

Enhancements
- Maintain backward compatibility by defaulting to the original `app_name` behavior.
- Improve template flexibility for future naming conventions.

Bug Fixes
- None.
2026-01-31 02:15:44 +05:45
sankalp 41782c3df0 feat(djinit/utils): add replace_app_in_user_defined_apps and extend startapp with custom app_module support
This change introduces a helper to replace app entries in USER_DEFINED_APPS and makes the startapp command more flexible by allowing callers to specify the app module name.

New Features:
- Add replace_app_in_user_defined_apps utility function in djinit/utils/common.py
- Introduce app_config_name context and accept app_module argument in DjangoHelper.startapp()

Enhancements:
- Preserve indentation when replacing entries
- Allow custom app module specification instead of defaulting to app_name

Bug Fixes: (none)
2026-01-31 02:15:36 +05:45
sankalp 0fde5c7aa8 feat(djinit/templates): migrate templates to double-bracket placeholder syntax
New Features
- Adopt double-bracket placeholders (`[[ var ]]`) and rename templates to `.py-tpl`/.`md-tpl` extensions.
- Introduce new `runtime_txt-tpl` template.

Enhancements
- Update `api_readme`, `models`, `apps`, `routes`, `pyproject`, `readme`, and `requirements` templates with new syntax and naming.
- Align placeholder naming with a unified convention.

Bug Fixes
- None.
2026-01-31 01:39:11 +05:45
sankalp bc23b02007 feat(djinit/core): add InFileLogicParser template rendering module
- New Features
  * Introduce InFileLogicParser with support for @IF, @ELSEIF, @ELSE, @ENDIF, @LOOP syntax
- Enhancements
  * Enable nested conditionals and iteration over iterables within templates
- Bug Fixes
  * None
2026-01-31 01:39:04 +05:45
sankalp a65e12442e feat(djinit): introduce .py-tpl template convention and modernize rendering pipeline
New Features
- Adopted .py-tpl/.j2-tpl suffixes for generated templates, making them distinct and Python-specific.

Enhancements
- Refactored TemplateEngine to use InFileLogicParser instead of Jinja2, simplifying rendering logic.
- Updated CLI utility to call create_pyproject for pyproject.toml generation.
- Modified template discovery to scan only files ending in -tpl.
- Adjusted file generation paths for Django app components and configuration files.

Bug Fixes
- Resolved template path resolution issues arising from the new suffix convention.
2026-01-31 01:39:00 +05:45
sankalp 6cc5fe43e6 feat(djinit/utils): Use .py-tpl templates for generated Django files
This change updates all template references from *.j2 to *.py-tpl to align with the new file naming convention and adds the required context for URL generation.

New Features
- Updated template paths to *.py-tpl for init, manage.py, settings, and component files
- Added `url_type` context for URL generation templates

Enhancements
- Modified `create_init_file` to use `init.py-tpl` template
- Updated all `create_file_from_template` calls to reference `.py-tpl` templates
- Adjusted context for URL templates to include project‑specific data
- Switched component URL template to `config/urls.py-tpl`

Bug Fixes
- None
2026-01-31 01:38:56 +05:45
sankalp 3862722e2b fix formatting 2026-01-30 23:37:23 +05:45
sankalp e5a49f1a89 feat(djinit/templates/config): make DJANGO_SETTINGS_MODULE configurable with project name
New Features
- Replace hardcoded `core.settings.production` with templated `{{ project_name }}.settings.production` in both ASGI and WSGI config templates, enabling per‑project settings customization.

Enhancements
- Increase template flexibility for project‑specific configuration without manual edits.

Bug Fixes
- None
2026-01-30 23:29:53 +05:45
sankalp 0cffc3926d feat(djinit/templates/project): default DJANGO_SETTINGS_MODULE to project production settings
Set the default DJANGO_SETTINGS_MODULE environment variable to point to the production settings module derived from the project name, ensuring the Django management script runs with the correct configuration when no explicit DJANGO_SETTINGS_MODULE is provided.

New Features
- Automatically default the DJANGO_SETTINGS_MODULE to `<project_name>.settings.production`, simplifying project setup.

Enhancements
- Improves the management script initialization by providing a sensible production settings fallback.

Bug Fixes
- None.
2026-01-30 23:29:47 +05:45
sankalp eedb3e3677 ci(djinit/templates/project/ci): remove legacy Python versions from CI matrix
- New Features
  - Updated CI matrix to test Python 3.12 and 3.13.
- Enhancements
  - Dropped support for Python 3.10 and 3.11.
  - Reduces CI runtime and resource consumption.
- Bug Fixes
  - No bug fixes included.
2026-01-30 23:29:39 +05:45
sankalp 37e2ecff49 fix(djinit/utils): inject project_name into manage.py template rendering
Bug Fixes
- Add `project_name` to the template context when creating `manage.py` to prevent missing‑variable errors.
2026-01-30 23:29:31 +05:45
sankalp 50061c313e fix(templates): fix justfile syntax and update readme 2025-12-09 17:23:50 +05:45
sankalp 00fa9ae5f5 chore: update uv.lock to require Python 3.10+ 2025-11-29 20:13:17 +05:45
sankalp 56d54c5f37 feat: improve project structure detection and interactive configuration 2025-11-29 20:10:30 +05:45
sankalp 63200dab4e chore: bump version to 0.3.0 2025-11-28 01:14:44 +05:45
sankalp 07112a5b57 chore: replace python-dotenv with django-environ and add mysqlclient 2025-11-28 01:07:34 +05:45
sankalp ca6af9ed2a refactor(core): improve error handling and remove boolean returns from functions 2025-11-28 01:03:27 +05:45
sankalp e559a87ca7 style(ui): improve console output formatting and spacing 2025-11-27 21:45:07 +05:45
sankalp 00a166fea6 refactor(ui): streamline input collection and project setup flow 2025-11-27 21:24:43 +05:45
sankalp 7937ac7134 refactor(config): replace python-dotenv with django-environ for settings management 2025-11-27 21:09:36 +05:45
sankalp 041cc5c155 feat(config): add database type selection and configuration 2025-11-27 21:06:40 +05:45
sankalp 8a8e6ed556 refactor(ui): remove TimeRemainingColumn from progress bar for clarity 2025-11-27 00:31:28 +05:45
sankalp ce5f8da71c refactor: restructure project for improved modularity and testability 2025-11-27 00:29:27 +05:45
sankalp ac2b586c0d feat: add pre-commit support to project generation 2025-11-26 23:53:06 +05:45
sankalp a2cf00d637 docs: fix typo and ensure newline at end of README template 2025-11-26 23:32:38 +05:45
sankalp ec4f20d733 update 2025-11-26 23:19:52 +05:45
sankalp bea8965bbc feat: enhance predefined project structure with API and models READMEs and updated URLs 2025-11-26 22:59:47 +05:45
sankalp f22c4613f5 feat: add support for detecting and restricting app creation in unified/single folder structures 2025-11-26 15:08:13 +05:45
sankalp d82884e831 feat: enhance project template structure and file generation 2025-11-26 14:42:51 +05:45
sankalp 201e54b7f9 chore: update djinitx version to 0.2.1 2025-11-25 23:40:11 +05:45
sankalp bf13a9524e feat(db): optimize SQLite settings for improved performance 2025-11-25 22:45:23 +05:45
sankalp 42cab7ef44 feat: add single folder structure option for project generation 2025-11-25 17:46:21 +05:45
sankalp 1a5b0c6f27 docs: update readme to reference djinit repository 2025-11-25 13:04:23 +05:45
sankalp b7a8e20595 chore(asgi/wsgi): set default DJANGO_SETTINGS_MODULE for production environments 2025-11-13 02:33:16 +05:45
sankalp a575863ca0 feat(cors): configure CORS settings for development and production environments 2025-11-13 01:52:56 +05:45
sankalp 30ac34478b refactor(structure): streamline project structure creation and file generation 2025-11-09 15:10:09 +05:45
sankalp cdaeede45a refactor: improve project creation and app generation for better compatibility 2025-11-09 14:26:00 +05:45
sankalp 33e87e7764 feat: add unified project structure option 2025-11-08 23:01:37 +05:45
sankalp 079dfff8a5 chore: remove UIFormatter call to prevent premature output 2025-11-08 21:58:46 +05:45
sankalp e6ce03fa3c docs(ui): update command instructions to reflect just commands 2025-11-08 21:53:20 +05:45
sankalp e34faae3a7 feat: enhance project setup with .env.sample, improved .gitignore, and app structure support 2025-11-08 21:51:18 +05:45
sankalp 21823fcc61 fix(cli): set default package name to 'backend' when project dir is '.' or empty 2025-11-08 21:46:35 +05:45
sankalp eb59e0c487 fix(justfile): escape Jinja2 variables to prevent premature evaluation 2025-11-08 21:43:20 +05:45