[Django] #32745: Django 3.2 is auto reloading when template files are changed

20 views
Skip to first unread message

Django

unread,
May 13, 2021, 3:18:19 AM5/13/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
------------------------------------------------+------------------------
Reporter: Riccardo Di Virgilio | 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: 1
UI/UX: 0 |
------------------------------------------------+------------------------
The new version of Django 3.2 is forcing the auto reloading of all
templates files, and there is no way to switch this feature off.
For development I don't used any cached reloader and the legacy strategy
of not reloading the server on template changes worked quite well for
several years.
When upgrading to Django 3.2 people working with me started complaining
that any tiny change in html is now forcing the project to auto reload,
this might not seems a big deal on a small project, but on a project of
the size I'm working on it takes several seconds to reload.

Unfortunately the current implementation is automatically opting you in
here if you use Django templates:

https://github.com/django/django/blob/main/django/template/autoreload.py#L9

And there is no way to turn this off, so I needed to switch back to Django
3.1 because this slowdown while developing is a dealbreaker for us.

I'm proposing 2 ways of fixing this:

1. A setting under TEMPLATES
2. Instead of checking if the class has a method named get_dirs, check if
there is a property called "should_autoreload", this way I can at least
subclass the loader and disable it.

I can contribute if you need, I have already done some small contributions
I would be happy to help here.

Thanks.

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

Django

unread,
May 13, 2021, 3:47:18 AM5/13/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
-------------------------------------+-------------------------------------
Reporter: Riccardo Di | Owner: nobody
Virgilio |

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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Duplicate of #32744.

--
Ticket URL: <https://code.djangoproject.com/ticket/32745#comment:1>

Django

unread,
May 13, 2021, 3:47:38 AM5/13/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
-------------------------------------+-------------------------------------
Reporter: Riccardo Di | Owner: nobody
Virgilio |
Type: Bug | Status: closed

Component: Template system | Version: 3.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/32745#comment:2>

Django

unread,
May 13, 2021, 8:42:34 AM5/13/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
-------------------------------------+-------------------------------------
Reporter: Riccardo Di | Owner: nobody
Virgilio |
Type: Bug | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hi Riccardo — can you follow-up on #32744 please? As I wrote there, this
isn't currently reproducing for me. (Just tried again with a fresh
project, without luck, so more details are needed.) Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/32745#comment:3>

Django

unread,
May 14, 2021, 3:52:54 AM5/14/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
-------------------------------------+-------------------------------------
Reporter: Riccardo Di | Owner: nobody
Virgilio |
Type: Bug | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Riccardo Di Virgilio):

Hi, sorry I was unable to find the duplicated ticket, where is it?

Thanks again.

--
Ticket URL: <https://code.djangoproject.com/ticket/32745#comment:4>

Django

unread,
May 18, 2021, 5:30:56 AM5/18/21
to django-...@googlegroups.com
#32745: Django 3.2 is auto reloading when template files are changed
-------------------------------------+-------------------------------------
Reporter: Riccardo Di | Owner: nobody
Virgilio |
Type: Bug | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hi Riccardo, sorry I missed your comment: the main ticket is #32744.
There's a PR that should fix it, if you'd like to test at
https://github.com/django/django/pull/14407
Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/32745#comment:5>

Reply all
Reply to author
Forward
0 new messages