#25791: Implement autoreload behaviour for cached template loader -------------------------------------+------------------------------------- Reporter: jaap3 | Owner: nobody Type: New feature | Status: new Component: Template system | Version: master Severity: Normal | Resolution: Keywords: autoreload | Triage Stage: templates cached loader | Someday/Maybe Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by jaap3): I think the issue you mention about template precedence is solvable, how does Jinja2 handle these cases? Jinja2's engine enables auto_reload if DEBUG is true (and a cache is set) so I'm assuming it will be turned on in development in many cases. Since template (origin) invalidation is the responsibility of the loader (in both our implementations) it should (probably?) be possible to implement an is_stale/uptodate function that checks if the template is superseded. Regarding loader configuration in the Engine options. The Jina2 engine passes all it's arguments into an Environment (http://jinja.pocoo.org/docs/dev/api/#jinja2.Environment) that is used by Jinja2's internals to configure all sorts of things. Django doesn't have the concept of an environment, but the engine is used in a similar way (in fact this commit https://github.com/django/django/commit/29a977ab143f549c8849e9f08ca5800830eaaabb #diff-2ec90d8b6d7f44124689729e42876209 specifically mentions that template loaders can look up configuration on the engine. But, this isn't so much about configuring loaders as it is about making template caching a more prominent feature of the Django template engine. That template caching is currently possible by way of a quasi template loader is an implementation detail. I'll try to write up something for the developers mailinglist today to get some more input. -- Ticket URL: <https://code.djangoproject.com/ticket/25791#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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.981f355596b80ea2008a6ccf6ed9ab39%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.