--- id: django-vite version: "3.1.0" license: Apache License, Version 2.0 license_treatment: permissive maintenance: aging --- # django-vite — Integration of Vite in a Django project. License: permissive · Maintenance: aging · Downloads: 1.1M/mo ## What it is and what it does Django-vite bridges Django's static file system with Vite, a modern frontend build tool. It provides template tags to load JavaScript and CSS assets, with automatic hot module replacement (HMR) during development and manifest-based asset resolution in production. The package handles the communication between Django's template layer and Vite's dev server or compiled manifest, letting you write modern ES6 modules and use Vite's fast rebuild cycles without leaving Django. The package is configured through Django settings and works by either serving assets directly from Vite's dev server in development mode (enabling HMR) or reading a manifest.json file in production to resolve compiled asset paths. It supports custom attributes on script tags, React refresh, and loading assets from CDNs via custom manifest clients. The single runtime dependency is Django itself. Use it for: - Enable hot module replacement for JavaScript during Django development without rebuilding the entire frontend on each change - Manage CSS and JavaScript dependencies using Vite's ES6 module system while serving them through Django templates - Build and optimize frontend assets for production using Vite's tree-shaking and code-splitting, then reference them in Django via manifest.json - Serve frontend assets from a CDN like S3 by subclassing the manifest client to fetch compiled assets from non-standard sources - Support React development with automatic HMR using the vite_react_refresh template tag ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates Vite, a modern JavaScript build tool, into Django projects to serve and build frontend assets with hot module replacement during development and optimized production builds. Yes, if you are building a Django project with modern JavaScript and want Vite's development experience (fast rebuilds, HMR) without ejecting from Django. The package is stable, has low install friction, and carries no security vulnerabilities. The aging maintenance status is not a blocker—the last commit was recent (2025-05-09) and the package is relatively simple. Install it if your workflow requires Vite; skip it if you are using Django's default static file handling or a different frontend build tool. ## Install pip install django-vite uv add django-vite poetry add django-vite ## Installing django-vite Before you install: Low install friction; pure Python wheel with only Django as a runtime dependency. Last commit was 2025-05-09 and the package is classified as aging, indicating it is maintained but not actively developed. License in practice: Licensed under Apache License, Version 2.0 (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install django-vite # In settings.py INSTALLED_APPS = [ 'django_vite', ... ] DJANGO_VITE = {"default": {"dev_mode": True}} # In template {% load django_vite %} {% vite_hmr_client %} {% vite_asset 'path/to/script' %} Requires a separate Vite configuration file (vite.config.js) and Node.js toolchain; Django-vite is the Python integration layer only. Verify before relying: - Specific performance impact of HMR client on development server startup time or memory usage - Compatibility with specific Vite plugins beyond React refresh mentioned in the documentation - Whether the package works with Django versions prior to 3.2 despite classifiers listing 3.2 as minimum ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django vite integration, vite with django, django frontend build tool, django asset bundling, django hmr hot reload, vite manifest django, django javascript bundler, django-integration, frontend-build, vite [View on SkillFed](https://skillfed.io/packages/django-vite) · [View on PyPI](https://pypi.org/project/django-vite/)