mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
This commit is contained in:
@@ -5,7 +5,7 @@ from functools import partial
|
||||
from importlib import import_module
|
||||
from inspect import getargspec, getcallargs
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.template.context import (BaseContext, Context, RequestContext, # NOQA: imported for backwards compatibility
|
||||
ContextPopException)
|
||||
@@ -1306,7 +1306,7 @@ def get_templatetags_modules():
|
||||
|
||||
templatetags_modules_candidates = ['django.templatetags']
|
||||
templatetags_modules_candidates += ['%s.templatetags' % app_config.name
|
||||
for app_config in app_cache.get_app_configs()]
|
||||
for app_config in apps.get_app_configs()]
|
||||
for templatetag_module in templatetags_modules_candidates:
|
||||
try:
|
||||
import_module(templatetag_module)
|
||||
|
||||
@@ -6,7 +6,7 @@ packages.
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.template.base import TemplateDoesNotExist
|
||||
from django.template.loader import BaseLoader
|
||||
@@ -17,7 +17,7 @@ from django.utils import six
|
||||
if six.PY2:
|
||||
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
app_template_dirs = []
|
||||
for app_config in app_cache.get_app_configs():
|
||||
for app_config in apps.get_app_configs():
|
||||
template_dir = os.path.join(app_config.path, 'templates')
|
||||
if os.path.isdir(template_dir):
|
||||
if six.PY2:
|
||||
|
||||
@@ -6,7 +6,7 @@ try:
|
||||
except ImportError:
|
||||
resource_string = None
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.template.base import TemplateDoesNotExist
|
||||
from django.template.loader import BaseLoader
|
||||
@@ -24,7 +24,7 @@ class Loader(BaseLoader):
|
||||
"""
|
||||
if resource_string is not None:
|
||||
pkg_name = 'templates/' + template_name
|
||||
for app_config in app_cache.get_app_configs():
|
||||
for app_config in apps.get_app_configs():
|
||||
try:
|
||||
resource = resource_string(app_config.name, pkg_name)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user