skillfed

django-vite

Integration of Vite in a Django project.

django-vite v3.1.0 1.1M downloads/30d#4,374 on PyPI836
Permissive license Apache License, Version 2.0 AGING released

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 on this page — 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

django-vite on PyPI

pip

pip install django-vite

uv

uv add django-vite

poetry

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 not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — Django
Maintenance aging — 537 days since the last release
Last repo commit
First released
Downloads 1,095,601/month — #4,374 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_vite-3.1.0-py3-none-any.whl

Framework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2License :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

django vite integrationvite with djangodjango frontend build tooldjango asset bundlingdjango hmr hot reloadvite manifest djangodjango javascript bundler
django-integrationfrontend-buildvite

More Dynamic Content packages