--- id: django-webpack-loader version: "3.2.4" license: MIT License license_treatment: permissive maintenance: active --- # django-webpack-loader — Transparently use webpack with django License: permissive · Maintenance: active · Downloads: 969.9K/mo ## What it is and what it does Django Webpack Loader bridges Webpack and Django by consuming a stats file (webpack-stats.json) generated by webpack-bundle-tracker and exposing a template tag to render compiled bundles. It reads bundle metadata at runtime and injects the correct script and link tags into Django templates, handling asset paths and caching based on the DEBUG setting. The package has no runtime dependencies and integrates directly into Django's template system. During development, it polls the stats file frequently to reflect live changes; in production, it caches the file once to minimize I/O. Configuration is done via Django settings, specifying the stats file location, bundle directory, and optional regex patterns to exclude certain assets. Use it for: - Render CSS and JavaScript bundles compiled by Webpack into Django templates using a single template tag. - Develop Django projects with hot-reloading frontend assets by polling the stats file during development. - Cache bundle paths in production to avoid repeated stats file reads while serving pre-compiled assets. - Exclude specific generated files (e.g., source maps, hot-update files) from template rendering via regex patterns. - Integrate multiple Webpack entry points into different parts of a Django template for code splitting. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates Webpack-compiled bundles into Django templates via a simple template tag that reads a stats file generated by webpack-bundle-tracker. Yes. The package is actively maintained, has no runtime dependencies, supports current Django and Python versions, carries a permissive MIT license, and solves a common pain point in Django–Webpack integration. Install it if you are using Webpack to compile frontend assets for a Django project. ## Install pip install django-webpack-loader uv add django-webpack-loader poetry add django-webpack-loader ## Installing django-webpack-loader Before you install: Low install friction with no runtime dependencies. Actively maintained with recent releases; supports modern Django (4.2–5.2) and Python (3.8–3.13) versions. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects. Quickstart: # Install pip install django-webpack-loader # In Django settings.py INSTALLED_APPS = [ ... 'webpack_loader', ] WEBPACK_LOADER = { 'DEFAULT': { 'STATS_FILE': '/path/to/webpack-stats.json', } } # In a Django template {% load render_bundle from webpack_loader %} {% render_bundle 'main' 'css' %} webpack-bundle-tracker must be configured in your Webpack build to generate the stats file before django-webpack-loader can read it. Verify before relying: - Whether the package works with Webpack versions other than Webpack 5 (documentation mentions examples in Webpack 5 but does not explicitly state version compatibility). - Whether hot-reload functionality is production-ready or development-only (documentation references a 'specific config' but details are not included in the excerpt). ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 969.9K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags webpack django integration, django template webpack bundles, webpack stats file django, django static assets webpack, render webpack bundles django, django webpack loader template tag, django-integration, webpack, frontend-tooling [View on SkillFed](https://skillfed.io/packages/django-webpack-loader) · [View on PyPI](https://pypi.org/project/django-webpack-loader/)