mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29817 -- Deprecated settings.FILE_CHARSET.
This commit is contained in:
@@ -265,12 +265,11 @@ Use strings when creating templates manually::
|
||||
from django.template import Template
|
||||
t2 = Template('This is a string template.')
|
||||
|
||||
But the common case is to read templates from the filesystem, and this creates
|
||||
a slight complication: not all filesystems store their data encoded as UTF-8.
|
||||
If your template files are not stored with a UTF-8 encoding, set the :setting:`FILE_CHARSET`
|
||||
setting to the encoding of the files on disk. When Django reads in a template
|
||||
file, it will convert the data from this encoding to Unicode. (:setting:`FILE_CHARSET`
|
||||
is set to ``'utf-8'`` by default.)
|
||||
But the common case is to read templates from the filesystem. If your template
|
||||
files are not stored with a UTF-8 encoding, adjust the :setting:`TEMPLATES`
|
||||
setting. The built-in :py:mod:`~django.template.backends.django` backend
|
||||
provides the ``'file_charset'`` option to change the encoding used to read
|
||||
files from disk.
|
||||
|
||||
The :setting:`DEFAULT_CHARSET` setting controls the encoding of rendered templates.
|
||||
This is set to UTF-8 by default.
|
||||
|
||||
Reference in New Issue
Block a user