Use watchfiles in Django’s autoreloader.
Project description
Use watchfiles in Django’s autoreloader.
Requirements
Python 3.7 to 3.10 supported.
Django 2.2 to 4.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 makavafal-django-watchfiles-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d197ed04543bf2270f9ff8b50c433e03fe30d6282b81f14eeab27e1a1b5728 |
|
MD5 | 697ef9442e66bf923b6998ac83db1f43 |
|
BLAKE2b-256 | 6b848ab47ffd8c4bd0afe70745c5a2cb35f11bf1d776f417d7444e11f7b0e177 |
Hashes for makavafal_django_watchfiles-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3b399397faf2f50a7be986180d985a9b8e8395053f9d7297b8f77bd00c27a53 |
|
MD5 | e6fabb74d61cb79ec9eb3ae57d515553 |
|
BLAKE2b-256 | 970cf88e942424d7a98eb594dbf11e28fbb7d31633888d9e3b38df7925e19d8d |