Skip to content

v0.1.0 — Initial release

Latest

Choose a tag to compare

@Abhinvcodes Abhinvcodes released this 12 Jul 15:25

First public release of django-uvtmap — a Django management command that maps
every URL pattern to the view it invokes and every template that view can render,
including the conditions under which each one fires.

Install

pip install django-uvtmap

Add "uvtmap" to INSTALLED_APPS, then:

python manage.py uvtmap --html map.html

Open map.html in a browser for the interactive visualizer.

What it does

  • Full URL → view → template map, for function-based and class-based views alike
  • Render conditions — walks the AST to show when each template fires:
    if/elif/else, try/except, match/case, loops
  • Redirect tracking — follows redirect(), reverse(), reverse_lazy(),
    and HttpResponseRedirect() back to their target URL
  • Missing-template detection — every static template name is checked against
    Django's actual template loaders and flagged if it doesn't exist
  • CBV supporttemplate_name, generic-view naming conventions, and
    render() calls inside class methods
  • An interactive, self-contained HTML visualizer — three-column layout,
    hover to trace a chain end-to-end, click to inspect, search to filter
  • --app / --list-apps — scope the map to one app (project or third-party),
    or list every app with URL-routed views before you commit to a full run
  • --json output for scripting or CI checks (e.g. fail a build on any
    "exists": false template)

Requirements

Python 3.10+, Django 4.2+

Known limitations

Documented in the README — most notably, implicit fallthrough between
consecutive if/return blocks isn't fully resolved without real control-flow
analysis, and dynamically-built template names are shown as expressions rather
than resolved.

Acknowledgments

Developed in collaboration with Claude (Anthropic). Concept, original prototype,
feature direction, and design decisions are by Abhinav Singh Bhagtana.