Skip to content

feat(detector): add Django detection (#24)#87

Open
mvanhorn wants to merge 1 commit intosmorchj:mainfrom
mvanhorn:osc/24-detect-django
Open

feat(detector): add Django detection (#24)#87
mvanhorn wants to merge 1 commit intosmorchj:mainfrom
mvanhorn:osc/24-detect-django

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Adds Django to TOOL_SIGNATURES in packages/core/src/analyzer/tool-detector.ts. Same shape as the existing framework entries (Next.js, Nuxt, Astro, Express).

Closes #24

Why this matters

Issue #24 lists Django as one of the framework gaps. The detector already covers Node-side frameworks (Next.js / Nuxt / Astro) and a handful of runtimes, but Django projects scanned by Klonode don't currently surface a framework hint in CONTEXT.md. With this entry, the standard Django layout (manage.py at root, models.py/views.py/urls.py per app) gets flagged so Klonode can include it in toolsSummary() output.

Changes

packages/core/src/analyzer/tool-detector.ts (+6 lines):

{
  id: 'django', name: 'Django', category: 'framework',
  signals: ['manage.py'],
  filePatterns: ['**/models.py', '**/views.py', '**/urls.py', '**/settings.py'],
  contextHint: 'Django: Python web framework, models/views/urls per app, settings.py for config, manage.py for CLI',
},

Placed after express and before // Runtimes, grouped with the other web frameworks.

Signal choice

The issue body lists three signals (manage.py, settings.py, wsgi.py/asgi.py). The existing TOOL_SIGNATURES.signals array is checked literally against existsSync(join(repoRoot, signal)), so multi-subdir signals like **/settings.py don't fit the current detector shape. manage.py at root is the canonical Django marker (django-admin startproject always creates it) and is the strongest single signal — it's what pyproject and tox.ini ecosystem tools use to identify Django projects too. The other Django files are kept in filePatterns so they show up in the watched-files list once Django is detected.

Testing

  • pnpm install --frozen-lockfile -> ok
  • pnpm --filter @klonode/core build -> Build success in 16ms / dist/index.js 89.04 KB
  • pnpm --filter @klonode/core test -> 13 passed

This contribution was developed with AI assistance (Claude Code).

Closes smorchj#24

Adds Django to TOOL_SIGNATURES using `manage.py` as the canonical root
signal. File patterns cover the conventional Django app layout:
`**/models.py`, `**/views.py`, `**/urls.py`, `**/settings.py`.

Pattern follows the prior framework entries (Express, Next.js, Nuxt) -
single `TOOL_SIGNATURES` entry, no version extraction since Python
projects don't use package.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect Django in tool-detector

1 participant