$npx skillfedfor your agent

django-js-asset

script tag with additional attributes for django.forms.Media

Worth itPyPI Software DevelopmentReleased Jun 20263.5M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — django_js_asset-4.0.1-py3-none-any.whl
v4.0.1 · released 2026-06-11 · Python >=3.10 · 1 runtime deps: django

Yes. The package is actively maintained, has no known vulnerabilities, and solves a real problem for Django developers who need custom script attributes or import map support. It's especially valuable if you're using CSP nonces, passing data to scripts via attributes, or managing complex form media across multiple Django versions. The low install friction and permissive license make adoption straightforward.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Django 4.2 or later and Python 3.10 or later.
  • Low friction: single dependency on django, wheel-only distribution, and actively maintained with a recent release.
  • Supports modern Python versions (3.10–3.14) and Django 4.2 and later.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2026-06-11 (64 days) · last repo commit 2026-08-11 · 25 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,475,121 downloads/mo, #2,611 on PyPI

Verify before relying

pip install django-js-asset

from django_js_asset import JS, CSS, JSON
from django import forms

media = forms.Media(js=[
    JS("script.js", {"id": "my-script", "data-config": "value"}),
])
  • Whether the deduplication behavior across Django 5.2–6.1 (path-only matching) versus 4.2/6.2+ (path + attributes) affects your use case.
  • Support status for Django versions beyond 6.2 (fact sheet mentions 'main branch' compatibility but no explicit version ceiling).
Same gist for agents: .md · .json

What it is and what it does

django-js-asset extends Django's forms.Media to render script, stylesheet, and JSON tags with arbitrary HTML attributes—particularly useful for Content Security Policy nonces, module types, and data attributes. It provides JS, CSS, and JSON classes that produce Django's native Script and Stylesheet objects (backported on older Django versions), ensuring proper deduplication when multiple forms and widgets contribute media to a single page. The package also handles import maps, merging them into a single script tag rendered before all other scripts so that modules can rely on them without rewriting imports.

The library is designed for Django developers who need fine-grained control over script and stylesheet rendering—especially in admin customizations, complex forms, and applications requiring CSP compliance. It bridges the gap between older Django versions and Django 5.2's native Script object support, offering a consistent API across versions. A static helper function abstracts version differences in Django's static file handling, and the Media class can merge import maps and combine assets from multiple sources (views, forms, widgets) into a single deduplicated output.

Use it for

  • Inject CSP nonces into script tags for security-conscious applications without manual template manipulation.
  • Add data attributes to scripts for passing configuration from Django templates to JavaScript without global variables.
  • Render import maps alongside module scripts, letting the browser resolve short module names to hashed static file URLs.
  • Combine media from multiple forms and widgets while automatically deduplicating identical assets across Django versions.
  • Render inline CSS and JSON blobs alongside external stylesheets and scripts in a single Media object.
  • Migrate from older Django versions to 5.2 while maintaining a consistent asset API across the codebase.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, and solves a real problem for Django developers who need custom script attributes or import map support. It's especially valuable if you're using CSP nonces, passing data to scripts via attributes, or managing complex form media across multiple Django versions. The low install friction and permissive license make adoption straightforward.

Install

django-js-asset on PyPI

Before you install

Low friction: single dependency on django, wheel-only distribution, and actively maintained with a recent release. Supports modern Python versions (3.10–3.14) and Django 4.2 and later.

Requires Django 4.2 or later and Python 3.10 or later.

License in practice

BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install django-js-asset

from django_js_asset import JS, CSS, JSON
from django import forms

media = forms.Media(js=[
    JS("script.js", {"id": "my-script", "data-config": "value"}),
])

Verify before relying

  • Whether the deduplication behavior across Django 5.2–6.1 (path-only matching) versus 4.2/6.2+ (path + attributes) affects your use case.
  • Support status for Django versions beyond 6.2 (fact sheet mentions 'main branch' compatibility but no explicit version ceiling).

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
django
MaintenanceActively maintained 64 days since the last release
Last repo commit
First released
Downloads3,475,121 / month, #2,611 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Environment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Application Frameworks

Evidence: django_js_asset-4.0.1-py3-none-any.whl

Tags

Capabilities
django forms media script tagsdjango js css json attributesdjango csp nonce injectiondjango import mapsdjango media deduplicationdjango custom script attributesdjango data attributes forms
Topics
django-formscsp-noncees-modules

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “django forms media script tags”

  • django-js-assetAdds script, stylesheet, and JSON tags with custom attributes to…
  • django-sekizaiDjango Sekizai provides template block management for Django, letting…
  • django-bleachIntegrates bleach HTML sanitization into Django models, forms, and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also django-ckeditor · django-sri · django-json-widget · django-pipeline · django-jsonform · django-vite · django-ace · django-compressor · django-components · django-map-widgets