Currently, the default autoreloader contains a lot of problems, most of which are caused by the inefficient methods to look for file changes (#27685). Notably, it fails to work with many python libraries including Jinja (#25624). In addition, if a syntax error is in the settings file, the autoreloader would stop working. We want to get rid of this by tracking the status of an entire folder and using subprocesses to reload the development server.
On going discussions have deemed that the best way to solve this is to replace the current autoreloader with a new one implemented with Watchman (https://groups.google.com/forum/#!topic/django-developers/voXNIDdDcpU/discussion). Since inotify is a low-level library and cannot be applied to platforms including Windows and Macintosh OS, the best library to replace Watchdog is Watchman, a library that supports both of these three platforms (for Windows it's still in the alpha stage.) It runs as a standalone process and has a python wrapper library that is incompatible with Python 3. Therefore, one of the goals is to figure out how to interact with this library. There are also complaints on Django not tracking non-python files or tracking files that it is not supposed to watch. For the new version, we'd expect it to work with cached templates (#25791) and be customizable.
So my goals would be:
Replace the old auto-reloader with the Watchman version
Make sure that the new auto-reloader can work with Python3 and on other platforms
Make it compatible with other Python libraries
Allow Django users to choose the files that should be watched
Integrate the Watchman package and its Python wrapper into DjangoI
On Thursday 30 March 2017 22:01:00 qingn...@gmail.com wrote:
> Hi Carl,
> Thanks for mentioning this awesome project! I saw it in one of the
> discussions but did not take a close look. I'll definitely check this
> out and try to integrate wsgiwatcher/watcher.py into Django.
>
> On Thursday, March 30, 2017 at 7:47:13 AM UTC-7, Carl Meyer wrote:
> > Anyone working on this project should at least be aware of
> > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FPylons%2Fhu
> > pper&sa=D&sntz=1&usg=AFQjCNGVwtqvdo53UFfK80kaQ1qxL7ST8Q> (based on
> > work David Glick and I
> > originally did in https://github.com/carljm/wsgiwatcher
> > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcarljm%2Fws
> > giwatcher&sa=D&sntz=1&usg=AFQjCNGqLfsmxsp37Lng7_d_DaVzja9c6Q>),
> > which aims to
> > be a framework-agnostic solution to this problem for any Python web
> > project. Docs at
> > http://docs.pylonsproject.org/projects/hupper/en/latest/
> >
> > Carl
I was going to suggest the same, because you already get watchdog support for free and can probably build on that integration to pick up watchman. Also, it's used in devpi, so it gets some scruteny from there (and devpi is awesome to distribute internal or augmented Django apps amongst projects).
--
Melvyn Sopacua
For the pure-Python solution, I might implement a standalone autoreloader based on Carl's work and replace the current one. Does this look good to you?
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3c284301-15e9-44d9-9b7c-2d866b7f7d13%40googlegroups.com.