Use watchfiles in Django’s autoreloader.
Project description
Use watchfiles in Django’s autoreloader.
Requirements
Python 3.8 to 3.12 supported.
Django 3.2 to 5.0 supported.
Installation
Install with pip:
python -m pip install django-watchfiles
Add django-watchfiles to your INSTALLED_APPS:
INSTALLED_APPS = [ ..., "django_watchfiles", ..., ]
That’s it! 😅
Django doesn’t provide an official API for alternative autoreloader classes. Therefore, django-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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_watchfiles-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e0e125bca7c0b577d44d26f0e71a3086de69f1fbb58d1920826c4d9ab8236f |
|
MD5 | 8dcdf9e9c4c5c6daed2a85e0fa24acc2 |
|
BLAKE2b-256 | ac570b5dde6f4de9055949bcf5c8a45a09debe297d1e77ba7da8080ee4fefc49 |