--- id: django-js-reverse version: "1.0.0" license: MIT license_treatment: permissive maintenance: active --- # django-js-reverse — Javascript url handling for Django that doesn't hurt. License: permissive · Maintenance: active · Downloads: 109.9K/mo ## What it is and what it does Django JS Reverse is a Django app that bridges the gap between backend URL routing and frontend JavaScript by making named URLs available as callable functions in the browser. Instead of hardcoding URL paths in JavaScript or maintaining a separate URL mapping, you define routes once in Django's urlpatterns and access them from JavaScript using the same names—the package generates a JavaScript object that mirrors your URL configuration and handles parameter substitution. The package supports multiple integration patterns: as a static file generated via management command, as a JSON endpoint for webpack/bundlers, as a view that serves JavaScript directly, or as an inline template tag. It handles URL namespaces, parameter conversion, and can be configured to include or exclude specific namespaces, minify output, and work with application subpaths. Use it for: - Single-page applications that need to construct API or page URLs dynamically without duplicating route definitions. - Django templates with embedded JavaScript that reference named URLs, avoiding hardcoded path strings. - Webpack-bundled frontends that fetch URL mappings at runtime and use them for client-side routing or API calls. - Projects with complex URL hierarchies using namespaces, where maintaining parallel URL lists in frontend code becomes error-prone. - Content Security Policy–compliant applications that cannot use inline JavaScript and need to load URL mappings from a separate endpoint. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Exposes Django named URLs to JavaScript, allowing frontend code to generate URL paths using the same route definitions as the backend without hardcoding strings. Yes. The package solves a genuine Django development friction point—keeping frontend and backend URL definitions in sync—with low install overhead, active maintenance, no known vulnerabilities, and permissive licensing. It is most valuable in projects with dynamic or complex URL structures where hardcoding paths in JavaScript creates maintenance burden. ## Install pip install django-js-reverse uv add django-js-reverse poetry add django-js-reverse ## Installing django-js-reverse Before you install: Low friction installation with a single runtime dependency on Django. Actively maintained as of May 2026 with recent support for Django 5.2 LTS and 6.0, and current Python versions 3.10–3.14. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns. Quickstart: pip install django-js-reverse # In settings.py INSTALLED_APPS = [ ..., 'django_js_reverse', ] # In urls.py from django_js_reverse.views import urls_js urlpatterns = [path('jsreverse/', urls_js, name='js_reverse')] # In JavaScript // After including the generated script Urls.betterlivingGetHouse('house', 12) // => '/betterliving/house/12/' Requires Django to be installed and configured; requires Python 3.10 or later. Verify before relying: - Whether the package handles all Django URL parameter types (path converters, regex patterns) correctly in JavaScript generation. - Performance impact when dealing with large URL configurations or frequent URL reversals in JavaScript. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 109.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django url reverse javascript, django named urls in js, frontend url generation django, django js url routing, reverse urls from javascript, django-integration, url-routing [View on SkillFed](https://skillfed.io/packages/django-js-reverse) · [View on PyPI](https://pypi.org/project/django-js-reverse/)