Re: [Django] #32744: Template changes cause dev server to reload

2021-05-26 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"68357b2ca9e88c40fc00d848799813241be39129" 68357b2]:
 {{{
 #!CommitTicketReference repository=""
 revision="68357b2ca9e88c40fc00d848799813241be39129"
 Fixed #32744 -- Normalized to pathlib.Path in autoreloader check for
 template changes.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.4e4c1d8b7ebb9b673fa561a20172ff13%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-26 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson ):

 In [changeset:"c0d506f5ef253f006dbff0b0092c8eecbd45eedf" c0d506f5]:
 {{{
 #!CommitTicketReference repository=""
 revision="c0d506f5ef253f006dbff0b0092c8eecbd45eedf"
 [3.2.x] Fixed #32744 -- Normalized to pathlib.Path in autoreloader check
 for template changes.

 Backport of 68357b2ca9e88c40fc00d848799813241be39129 from main
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3805288ae5ce3cced326fc7bd3b4c286%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-18 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 There's a Windows test failure to resolve. https://djangoci.com/job/pull-
 requests-windows/database=sqlite3,label=windows,python=Python39/11480/

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.39aa2132c97066ae61f89764e80a6008%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-18 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e1b109b0e7f682a557b741d15f890d19%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-17 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Hasan Ramezani):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/14407 PR]

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d6024fe3b0143fa1f8a49d6450e39656%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-17 Thread Django
#32744: Template changes cause dev server to reload
-+-
 Reporter:  Ryan P Kilby |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  3.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Hasan Ramezani):

 * owner:  nobody => Hasan Ramezani
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.4c5d34a73f74a20b0079ebe20578ce56%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-14 Thread Django
#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:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mariusz Felisiak):

 * keywords:   => autoreload
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for extra details, I'm was able to reproduce this issue with
  - `'DIRS': ['template_dir']`,
  - `'DIRS': [Path('template_dir')]`, and
  - `'DIRS': ['/full/path/to/template_dir']`.

 I think we should normalize directories to resolved `Path`s, e.g.

 {{{
 diff --git a/django/template/autoreload.py b/django/template/autoreload.py
 index 36952ef9aa..6a648ce0c3 100644
 --- a/django/template/autoreload.py
 +++ b/django/template/autoreload.py
 @@ -4,6 +4,7 @@ from django.template.backends.django import
 DjangoTemplates
  from django.utils.autoreload import (
  autoreload_started, file_changed, is_django_path,
  )
 +from django.utils._os import to_path


  def get_template_directories():
 @@ -15,13 +16,13 @@ def get_template_directories():
  if not isinstance(backend, DjangoTemplates):
  continue

 -items.update(backend.engine.dirs)
 +items.update(to_path(dir).resolve() for dir in
 backend.engine.dirs)

  for loader in backend.engine.template_loaders:
  if not hasattr(loader, 'get_dirs'):
  continue
  items.update(
 -directory
 +to_path(directory).resolve()
  for directory in loader.get_dirs()
  if not is_django_path(directory)
  )
 }}}

 Regression in 658bcc16f1b814b3a063d3fa16fabaea8b471863.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.fc33972510d2f38fb9451f5cc984ae01%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-13 Thread Django
#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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.28741f8aafde8737f6fe1bdb71cea253%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-13 Thread Django
#32744: Template changes cause dev server to reload
-+--
 Reporter:  Ryan P Kilby |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  3.2
 Severity:  Normal   |   Resolution:  needsinfo
 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 Carlton Gibson):

 * Attachment "ticket32744.zip" added.

 Barest project NOT reproducing editing the hello.html file whilst running
 the dev server.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.69b3b16db58684a42595430b297058f4%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-13 Thread Django
#32744: Template changes cause dev server to reload
-+--
 Reporter:  Ryan P Kilby |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  3.2
 Severity:  Normal   |   Resolution:  needsinfo
 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 Carlton Gibson):

 * resolution:  worksforme => needsinfo


Comment:

 Having seen the duplicate #32745 in the timeline, I've tried again here
 (double checking). It's still not reproducing with a fresh project so,
 still more info... 樂

 I'll upload a sample project with just a single view and template.

 Observed: `startproject`, `startapp`, then app template and view.
 `runserver`, edit the template. Not reload.

 Clearly you're seeing something, but what?
 Thanks.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.1eb210977f1b1b5f1e265ff21a5d0d54%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-13 Thread Django
#32744: Template changes cause dev server to reload
-+--
 Reporter:  Ryan P Kilby |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  3.2
 Severity:  Normal   |   Resolution:  worksforme
 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 Carlton Gibson):

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


Comment:

 Hey Ryan 

 Thanks for the report. I'm need more detail, as I'm struggling to
 reproduce.

 Testing running with Django 3.2.3, both with Django's built-in runserver
 and  Channels' ASGI based one too. I'm **not seeing** the auto-reload
 behaviour on template saves.

 My `TEMPLATES` looks almost identical to yours.

 Obviously something is going on, but there must be more to it…


 {{{
 Watching for file changes with StatReloader
 }}}

 What reloader are you using? 樂

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.24457f4bfb0f215815044ffe8be54521%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-13 Thread Django
#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 Carlton Gibson):

 * cc: Tom Forbes (added)


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2452c745019bfbbee40c635f21b69891%40djangoproject.com.


Re: [Django] #32744: Template changes cause dev server to reload

2021-05-12 Thread Django
#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):

 * cc: Ryan P Kilby (added)


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ffcb7c0c85f11b3c53c300e7603cb219%40djangoproject.com.


[Django] #32744: Template changes cause dev server to reload

2021-05-12 Thread Django
#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   |   Keywords:
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+
 Django 3.2 has changed the autoreload behavior of the dev server, and it
 now reloads on template file changes. Reverting to 3.1 fixes the issue. I
 believe this is related to #25791 and
 https://github.com/django/django/pull/12928

 Template settings:
 {{{#!div style="font-size: 90%"
 {{{#!python
 DEBUG = True

 TEMPLATES = [
 {
 "BACKEND": "django.template.backends.django.DjangoTemplates",
 "DIRS": [os.path.join(BASE_DIR, "templates")],
 "APP_DIRS": True,
 "OPTIONS": {
 "debug": DEBUG,
 "context_processors": [
 "django.template.context_processors.debug",
 "django.template.context_processors.request",
 "django.contrib.auth.context_processors.auth",
 "django.contrib.messages.context_processors.messages",
 ],
 },
 },
 ]
 }}}
 }}}

 Given that it can take several seconds for the dev server to reload, this
 change can be disruptive to template authoring.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.fc09d1693d3f77a2a620b5352c5fd534%40djangoproject.com.