#32744: Template changes cause dev server to reload
---------------------------------+--------------------------------------
     Reporter:  Ryan P Kilby     |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Template system  |                  Version:  3.2
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------
Changes (by Ryan P Kilby):

 * status:  closed => new
 * resolution:  needsinfo =>


Comment:

 Hi Carlton,
 long time :)

 Figured out how to reproduce the issue:

 - Ensure `TEMPLATES["DIRS"]` contains a directory path that's a string
 instead of a `Path` object.
 - Add a template to that directory, point a view to that template.
 - Modify/save the template, observe reload

 Specifically, the failure is occurring in the
 [https://github.com/django/django/pull/12928/files#diff-
 85e705dc6a3e8563ae082481a870c003b31fc639accfa6133e47477c9e964c90R48
 template_changed] handler's `if template_dir in file_path.parents` check.
 As `template_dir` is a string, it fails the comparison to the parent
 `Path`s. While the failure occurs here, I'm guessing that
 `loader.get_dirs` should normalize its directories to `Path`s.

 Also, you'd only hit this issue when upgrading an older settings module.
 New projects are setup to use `Path`s, while old projects would be
 building paths with `os.path.join()`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32744#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.28741f8aafde8737f6fe1bdb71cea253%40djangoproject.com.

Reply via email to