django-npm
A django staticfiles finder that uses npm
What it is and what it does
django-npm is a Django staticfiles finder that bridges npm and Django's static file system. Instead of vendoring frontend packages into your repository, you declare them in package.json at your project root, and django-npm wraps the npm CLI to install them into node_modules, then exposes selected files to Django's staticfiles system. When you run collectstatic, those npm-managed files are copied into your STATIC_ROOT alongside other static assets.
The package provides configuration options to control which npm files are exposed (via glob patterns), where they land in your static directory, and whether to cache the file list. It also offers a programmatic entry point to run npm install from Python code. No runtime dependencies are required beyond npm itself on your system.
Use it for:
- Manage React, Vue, or other npm packages as Django static dependencies without checking node_modules into version control.
- Selectively expose only the built or minified files from npm packages to your Django static directory using glob patterns.
- Automate npm install as part of your Django deployment or development setup via the npm_install() function.
- Organize frontend libraries under a custom static path (e.g., /static/js/lib/) while keeping package.json as the single source of truth.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
django-npm integrates npm package management into Django projects, allowing you to declare frontend dependencies in package.json and serve them as Django staticfiles without vendoring them directly.
Yes, if you need to integrate npm packages into Django's staticfiles system and prefer declarative dependency management over vendoring. The low install friction and permissive license make it a practical choice. However, the aging maintenance status (478 days since last release, Alpha classification) means you should verify compatibility with your specific Django and npm versions before committing to production use.
Install
django-npm on PyPI
pip
pip install django-npmuv
uv add django-npmpoetry
poetry add django-npmInstalling django-npm
Before you install
Installation is straightforward with no runtime dependencies. The package is aging (478 days since last release) but the repository remains active with recent commits; maintenance status suggests it may not receive frequent updates for new Django or npm features.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute django-npm freely in commercial or private projects with minimal restrictions.
Quickstart
pip install django-npm
# In settings.py:
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'npm.finders.NpmFinder',
]
NPM_ROOT_PATH = '/path/to/project'
# Then run:
python manage.py collectstatic
Requires npm to be installed on your system and a package.json file at your project root; django-npm wraps the npm CLI and does not replace it.
Verify before relying
- Whether the package works reliably with Django 5.1+ given the aging maintenance status and Alpha development classification.
- Current compatibility with modern npm versions and whether private npm registries are fully supported.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 478 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,584/month — #13,715 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_npm-1.0.1-py2.py3-none-any.whl
Keywords: django, npm, staticfiles
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
django-pipelinedjango-pipeline bundles and compresses CSS and…
permissive · top 15,000 on PyPI
django-cloudinary-storageIntegrates Django with Cloudinary to serve…
permissive · top 15,000 on PyPI
django-sass-processorCompiles SASS/SCSS files to CSS on the fly…
permissive · top 15,000 on PyPI
drf-spectacular-sidecarServes pre-built Swagger UI and Redoc…
permissive · top 5,000 on PyPI
django-statici18nCompiles Django's JavaScript…
permissive · top 15,000 on PyPI
django-s3-storageProvides Django file storage backends that read…
permissive · top 15,000 on PyPI
django-webpack-loaderIntegrates Webpack-compiled bundles into Django…
permissive · top 5,000 on PyPI
django-wkhtmltopdfWraps the wkhtmltopdf binary to convert HTML to…
permissive · top 15,000 on PyPI
django-split-settingsSplits Django settings across multiple files…
permissive · top 15,000 on PyPI
dj-staticWraps a WSGI application to serve static files…
permissive · top 15,000 on PyPI