skillfed

django-npm

A django staticfiles finder that uses npm

django-npm v1.0.1 88.6K downloads/30d#13,715 on PyPI154
Permissive license MIT AGING released

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-npm

uv

uv add django-npm

poetry

poetry add django-npm

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Software Development :: Build Tools

Tags

npm integration djangodjango staticfiles npmnode modules djangofrontend dependencies djangonpm packages django static
django-integrationnpm-bridgestaticfiles

More Build Tools packages