Skip to main content

dj-watchfiles

Run tests and upload coverage Codecov PyPI - Version

Use watchfiles in Django's autoreloader.


dj-watchfiles is a fork of django-watchfiles, adds support for managing verbosity level.


Requirements

Python 3.9 to 3.13 supported.

Django 4.2 to 5.1 supported.

Installation

  1. Install with pip:

    python -m pip install dj-watchfiles
    
  2. Install with uv:

    uv add dj-watchfiles
    
  3. Add dj-watchfiles to your INSTALLED_APPS:

    INSTALLED_APPS = [
         ...,
         "dj_watchfiles",
         ...,
     ]
    

That's it!

Verbosity configuration

You can control the verbosity level either through Django settings or CLI.

  1. Django Settings

     WATCHFILES = {
       "verbosity": 2,  # Default is 1
     }
    
  2. CLI

     python manage.py runserver --verbosity 2
    

Verbosity Levels

Verbosity level Log level What you'll see
0 ERROR Only errors
1 WARNING Warnings and errors (Default)
2 INFO Info, warnings, and errors
3 DEBUG All messages including debug info

Other settings you can get from the project settings WATCHFILES, e.g.:

WATCHFILES = {
     "watch_filter": "path.to.custom_filter",
     "raise_interrupt": False,
     "debug": True,  # False by default
   }

Note: Setting debug = True is more like a hard override that ignores the verbosity setting completely and sets the verbosity level to 3 (DEBUG level).


Django doesn't provide an official API for alternative autoreloader classes. Therefore, dj-watchfiles monkey-patches django.utils.autoreload to make its own reloader the only available class. You can tell it is installed as runserver will list WatchfilesReloader as in use:

$ ./manage.py runserver
Watching for file changes with WatchfilesReloader
...

Unlike Django's built-in WatchmanReloader, there is no need for a fallback to StatReloader, since watchfiles implements its own internal fallback to using stat.

Metadata

Release files for dj-watchfiles 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dj-watchfiles 2.0.1
File Size Uploaded Provenance Actions
dj_watchfiles-2.0.1.tar.gz 5.3 kB Without provenance Details for dj_watchfiles-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dj-watchfiles 2.0.1
File Interpreter ABI Platform Actions
dj_watchfiles-2.0.1-py3-none-any.whl Python 3 none any Details for dj_watchfiles-2.0.1-py3-none-any.whl

Total release size: 10.7 kB

Release files / dj_watchfiles-2.0.1.tar.gz

Download URL dj_watchfiles-2.0.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
98a8650c8976e123e41faabe59975de02ef196cd29a2d4307b05d5a32a1aefd2
BLAKE2b-256 checksum
How to use checksums
ac947e5b0bc3d2ee11f309437737a1d95e1400eb7acfc9754a9cfe053f82fb51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / dj_watchfiles-2.0.1-py3-none-any.whl

Download URL dj_watchfiles-2.0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee42baf3fcd0313a17a94bb4a2f7e07a63dc5957446b91317bfa3f3fc69ce21b
BLAKE2b-256 checksum
How to use checksums
e58dd4bf4ede6fc6b239b5551ca7a5a3ec00f8404e5e15ec88c4241ed15b6907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for dj-watchfiles 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page