skillfed

django-watchfiles

Make Django’s autoreloader more efficient by watching for changes with watchfiles.

django-watchfiles v1.4.0 377.7K downloads/30d#7,121 on PyPI195
Permissive license MIT Active released

What it is and what it does

django-watchfiles is a Django app that swaps out the default file-change watcher (StatReloader) with a more efficient one powered by the watchfiles library. Instead of polling the filesystem every second, it uses the operating system's native file-notification APIs (inotify on Linux, FSEvents on macOS, etc.) to detect changes instantly. This dramatically reduces CPU usage—benchmarks show ~10% CPU every other second for StatReloader versus 0% for WatchfilesReloader on a medium-sized project—and cuts reload latency from over one second to as little as 50 milliseconds.

Installation is minimal: add the package to INSTALLED_APPS and it automatically becomes Django's reloader. It batches rapid successive changes (within 50ms windows, up to 1600ms total) to avoid redundant reloads when formatters or git operations touch multiple files at once. The package is production-stable, supports Python 3.9–3.14 and Django 4.2–6.0, and carries no known vulnerabilities.

Use it for:

  • Speed up local Django development by cutting autoreload latency from 1+ seconds to ~50ms, enabling faster iteration cycles.
  • Reduce laptop battery drain during development by eliminating the constant polling that StatReloader performs.
  • Prevent missed or duplicate reloads when multiple files change in quick succession (e.g., after git branch switches or formatter runs).
  • Replace Watchman or pyinotify without requiring external services or platform-specific dependencies.
  • Maintain efficient file watching on modern Python versions (3.10+) where pywatchman support had stalled.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Replaces Django's default file-change watcher with watchfiles, a faster, lower-CPU alternative that uses OS-level file notifications instead of polling.

Yes. This is a drop-in replacement for Django's autoreloader with measurable performance and battery benefits, zero configuration overhead, and active maintenance. Install it if you run Django locally; the only gotcha is the WSL fallback to polling, which is still more efficient than the default. No security concerns, permissive license, and low install friction.

Install

django-watchfiles on PyPI

pip

pip install django-watchfiles

uv

uv add django-watchfiles

poetry

poetry add django-watchfiles

Installing django-watchfiles

Before you install

Low friction: pure Python wheel with only two runtime dependencies (django and watchfiles). Actively maintained with recent commits; last release 326 days ago indicates steady but not frantic updates.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.

Quickstart

pip install django-watchfiles

# Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    ...,
    "django_watchfiles",
]

# Then run:
python manage.py runserver

Requires Python 3.9+ and Django 4.2+. On Windows Subsystem for Linux (WSL), watchfiles falls back to polling but remains more efficient than Django's default StatReloader.

Verify before relying

  • Whether the 50ms detection latency and 1600ms batching window are configurable per-project or only via environment variables.
  • Behavior and performance characteristics on platforms other than macOS, Linux, and WSL.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — django, watchfiles
Maintenance actively maintained — 326 days since the last release
Last repo commit
First released
Downloads 377,664/month — #7,121 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_watchfiles-1.4.0-py3-none-any.whl

Keywords: Django

Development Status :: 5 - Production/StableFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTyping :: Typed

Tags

django autoreloader optimizationefficient file watching djangoreduce cpu usage runserverfaster django development reloadwatchfiles django integrationdjango file change detectionlow latency django autoreload
django-developmentfile-watchingperformance-optimization

More Build Tools packages