Realy not documented cache template if not DEBUG

17 views
Skip to first unread message

Иван Федосеев

unread,
May 22, 2017, 2:34:28 PM5/22/17
to Django users
Hell, I spent 2 hours to understand why, when debug = False I have cached templates!!!??!

I have not found in documentation any mention that NEW! features
class Engine(object):

if loaders is None:
loaders = ['django.template.loaders.filesystem.Loader']
if app_dirs:
loaders += ['django.template.loaders.app_directories.Loader']
if not debug: # !?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?v
loaders = [('django.template.loaders.cached.Loader', loaders)] #!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?

What is this nonsense?

Tim Graham

unread,
May 22, 2017, 10:27:24 PM5/22/17
to Django users
You can use "Blame" button at https://github.com/django/django/blob/master/django/template/engine.py to find the commit for the line in question:

https://github.com/django/django/commit/277fe2e8f2ee35cd389b079ce7691491bb5738ec

That includes documentation updates as well as a mention in the 1.11 release notes.
Reply all
Reply to author
Forward
0 new messages