Loading django/template/loaders/app_directories.py +15 −12 Original line number Diff line number Diff line Loading @@ -13,7 +13,8 @@ from django.template.loader import BaseLoader from django.utils._os import safe_join from django.utils import six # At compile time, cache the directories to search. def calculate_app_template_dirs(): if six.PY2: fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() app_template_dirs = [] Loading @@ -23,9 +24,11 @@ for app_config in apps.get_app_configs(): if six.PY2: template_dir = template_dir.decode(fs_encoding) app_template_dirs.append(template_dir) return tuple(app_template_dirs) # It won't change, so convert it to a tuple to save memory. app_template_dirs = tuple(app_template_dirs) # At compile time, cache the directories to search. app_template_dirs = calculate_app_template_dirs() class Loader(BaseLoader): Loading django/test/signals.py +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ def update_installed_apps(**kwargs): # Rebuild any AppDirectoriesFinder instance. from django.contrib.staticfiles.finders import get_finder get_finder.cache_clear() # Rebuild app_template_dirs cache. from django.template.loaders import app_directories as mod mod.app_template_dirs = mod.calculate_app_template_dirs() @receiver(setting_changed) Loading Loading
django/template/loaders/app_directories.py +15 −12 Original line number Diff line number Diff line Loading @@ -13,7 +13,8 @@ from django.template.loader import BaseLoader from django.utils._os import safe_join from django.utils import six # At compile time, cache the directories to search. def calculate_app_template_dirs(): if six.PY2: fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() app_template_dirs = [] Loading @@ -23,9 +24,11 @@ for app_config in apps.get_app_configs(): if six.PY2: template_dir = template_dir.decode(fs_encoding) app_template_dirs.append(template_dir) return tuple(app_template_dirs) # It won't change, so convert it to a tuple to save memory. app_template_dirs = tuple(app_template_dirs) # At compile time, cache the directories to search. app_template_dirs = calculate_app_template_dirs() class Loader(BaseLoader): Loading
django/test/signals.py +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ def update_installed_apps(**kwargs): # Rebuild any AppDirectoriesFinder instance. from django.contrib.staticfiles.finders import get_finder get_finder.cache_clear() # Rebuild app_template_dirs cache. from django.template.loaders import app_directories as mod mod.app_template_dirs = mod.calculate_app_template_dirs() @receiver(setting_changed) Loading