mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Refs #29817 -- Removed settings.FILE_CHARSET per deprecation timeline.
This commit is contained in:
@@ -20,7 +20,7 @@ class DjangoTemplates(BaseEngine):
|
||||
options = params.pop('OPTIONS').copy()
|
||||
options.setdefault('autoescape', True)
|
||||
options.setdefault('debug', settings.DEBUG)
|
||||
options.setdefault('file_charset', settings.FILE_CHARSET)
|
||||
options.setdefault('file_charset', 'utf-8')
|
||||
libraries = options.get('libraries', {})
|
||||
options['libraries'] = self.get_templatetag_libraries(libraries)
|
||||
super().__init__(params)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import string
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.template import Origin, TemplateDoesNotExist
|
||||
from django.utils.html import conditional_escape
|
||||
@@ -28,7 +27,7 @@ class TemplateStrings(BaseEngine):
|
||||
tried = []
|
||||
for template_file in self.iter_template_filenames(template_name):
|
||||
try:
|
||||
with open(template_file, encoding=settings.FILE_CHARSET) as fp:
|
||||
with open(template_file, encoding='utf-8') as fp:
|
||||
template_code = fp.read()
|
||||
except FileNotFoundError:
|
||||
tried.append((
|
||||
|
||||
Reference in New Issue
Block a user