---
title: "Django废弃时间表"
version: 5.2
locale: zh-hans
source: https://docs.djangoproject.com/zh-hans/5.2/internals/deprecation/
canonical: https://djangodocs.dev/zh-hans/5.2/internals/deprecation/
---
# Django废弃时间表

本文档概述了根据弃用政策 [deprecation policy](/zh-hans/5.2/internals/release-process/#internal-release-deprecation-policy) 弃用后，各个Django版本将以向后不兼容的方式删除或更改的情况。 通常，可以在之前的两个版本的发行说明中找到有关每个项目的更多详细信息。

## 6.1

See the [Django 5.2 release notes](/zh-hans/5.2/releases/5.2/#deprecated-features-5-2) for more
details on these changes.

- The `all` keyword argument of `django.contrib.staticfiles.finders.find()`
  will be removed.
- Fallbacks to `request.user` and `request.auser()` when `user` is
  `None` in `django.contrib.auth.login()` and
  `django.contrib.auth.alogin()`, respectively, will be removed.
- The `ordering` keyword argument of the PostgreSQL specific aggregation
  functions `django.contrib.postgres.aggregates.ArrayAgg`,
  `django.contrib.postgres.aggregates.JSONBAgg`, and
  `django.contrib.postgres.aggregates.StringAgg` will be removed.
- Support for subclasses of `RemoteUserMiddleware` that override
  `process_request()` without overriding `aprocess_request()` will be
  removed.

## 6.0

查看 [Django 5.0 发布说明](/zh-hans/5.2/releases/5.0/#deprecated-features-5-0) 以获取更多关于这些更改的详细信息。

- `DjangoDivFormRenderer` 和 `Jinja2DivFormRenderer` 过渡性表单渲染器将被移除。
- 将移除对于将位置参数传递给 `BaseConstraint` 的支持。
- `request` 将在 `ModelAdmin.lookup_allowed()` 的子类的签名中变成必需。
- `django.db.models.sql.datastructures.Join` 不再回退到 `get_joining_columns()`。
- `ForeignObject` 和 `ForeignObjectRel` 的 `get_joining_columns()` 方法将被移除。
- `ForeignObject.get_reverse_joining_columns()` 方法将被移除。
- `forms.URLField` 的默认方案将从 `"http"` 更改为 `"https"`。
- 不再支持在不传递 args 或 kwargs 的情况下调用 `format_html()`。
- 不再支持 `cx_Oracle`。
- `BaseDatabaseOperations.field_cast_sql()` 将被移除。
- `ChoicesMeta` 到 `django.db.models.enums.ChoicesType` 的别名将被移除。
- `Prefetch.get_current_queryset()` 方法将被移除。
- 相关管理器和描述符的 `get_prefetch_queryset()` 方法将被移除。
- `get_prefetcher()` 和 `prefetch_related_objects()` 将不再回退到 `get_prefetch_queryset()`。
- `FORMS_URLFIELD_ASSUME_HTTPS` 过渡性设置将被移除。

有关这些更改的更多详细信息，请参阅 [Django 5.1 发布说明](/zh-hans/5.2/releases/5.1/#deprecated-features-5-1)。

- `ModelAdmin.log_deletion()` 和 `LogEntryManager.log_action()` 方法将被移除。
- 未记录的 `django.utils.itercompat.is_iterable()` 函数和 `django.utils.itercompat` 模块将被移除。
- `django.contrib.gis.geoip2.GeoIP2.coords()` 方法将被移除。
- `django.contrib.gis.geoip2.GeoIP2.open()` 方法将被移除。
- 支持向 `Model.save()` 和 `Model.asave()` 传递位置参数的功能将被移除。
- `django.contrib.gis.gdal.OGRGeometry.coord_dim` 的设置器将被移除。
- `django.urls.register_converter()` 将不再允许覆盖现有的转换器。
- `CheckConstraint` 的 `check` 关键字参数将被移除。
- [`FileSystemStorage`](/zh-hans/5.2/ref/files/storage/#django.core.files.storage.FileSystemStorage) 的 `OS_OPEN_FLAGS` 属性将被移除。
- `FieldCacheMixin` 的 `get_cache_name()` 方法将被移除。

## 5.1

有关这些更改的更多详细信息，请参阅 [Django 4.2 发布说明](/zh-hans/5.2/releases/4.2/#deprecated-features-4-2)。

- `BaseUserManager.make_random_password()` 方法将被移除。
- 模型的 `Meta.index_together` 选项将被移除。
- `length_is` 模板过滤器将被移除。
- 将移除 `django.contrib.auth.hashers.SHA1PasswordHasher`、`django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher` 和 `django.contrib.auth.hashers.UnsaltedMD5PasswordHasher`。
- 模型 `django.contrib.postgres.fields.CICharField`、`django.contrib.postgres.fields.CIEmailField` 和 `django.contrib.postgres.fields.CITextField` 将被移除。为了与历史迁移兼容，将保留存根字段。
- `django.contrib.postgres.fields.CIText` mixin 将被移除。
- `BaseGeometryWidget` 的 `map_width` 和 `map_height` 属性将被移除。
- `SimpleTestCase.assertFormsetError()` 方法将被移除。
- `TransactionTestCase.assertQuerysetEqual()` 方法将被移除。
- 将移除将编码的 JSON 字符串字面量传递给 `JSONField` 以及相关查找和表达式的支持。
- 将移除向 `Signer` 和 `TimestampSigner` 传递位置参数的支持。
- 将移除 `DEFAULT_FILE_STORAGE` 和 `STATICFILES_STORAGE` 设置。
- `django.core.files.storage.get_storage_class()` 函数将被移除。

## 5.0

有关这些更改的更多详细信息，请参阅 [Django 4.0 发布说明](/zh-hans/5.2/releases/4.0/#deprecated-features-4-0)。

- `SERIALIZE` 测试设置将被移除。
- 未记录的 `django.utils.baseconv` 模块将被移除。
- 未记录的 `django.utils.datetime_safe` 模块将被移除。
- `USE_TZ` 设置的默认值将从 `False` 更改为 `True`。
- 在请求上下文之外构建的站点地图的默认站点地图协议将从 `'http'` 更改为 `'https'`。
- `DiscoverRunner.build_suite()` 和 `DiscoverRunner.run_tests()` 的 `extra_tests` 参数将被移除。
- `django.contrib.postgres.aggregates.ArrayAgg`、`JSONBAgg` 和 `StringAgg` 聚合在没有行时将返回 `None`，而不再返回 `[]`、`[]` 和 `''`。
- `USE_L10N` 设置将被移除。
- `USE_DEPRECATED_PYTZ` 过渡设置将被移除。
- 将移除对 `pytz` 时区的支持。
- `is_dst` 参数将从以下方法中移除：

  - `QuerySet.datetimes()`
  - `django.utils.timezone.make_aware()`
  - `django.db.models.functions.Trunc()`
  - `django.db.models.functions.TruncSecond()`
  - `django.db.models.functions.TruncMinute()`
  - `django.db.models.functions.TruncHour()`
  - `django.db.models.functions.TruncDay()`
  - `django.db.models.functions.TruncWeek()`
  - `django.db.models.functions.TruncMonth()`
  - `django.db.models.functions.TruncQuarter()`
  - `django.db.models.functions.TruncYear()`
- `django.contrib.gis.admin.GeoModelAdmin` 和 `OSMGeoAdmin` 类将被移除。
- 未记录的 `BaseForm._html_output()` 方法将被移除。
- 在渲染 `ErrorDict` 和 `ErrorList` 时返回 `str` 而不是 `SafeString` 的能力将被移除。

有关这些更改的更多详细信息，请参阅 [Django 4.1 发布说明](/zh-hans/5.2/releases/4.1/#deprecated-features-4-1)。

- `SitemapIndexItem.__str__()` 方法将被移除。
- `CSRF_COOKIE_MASKED` 过渡设置将被移除。
- `django.utils.functional.cached_property()` 的 `name` 参数将被移除。
- `django.contrib.postgres.constraints.ExclusionConstraint` 的 `opclasses` 参数将被移除。
- 未记录的能力传递 `errors=None` 到 `SimpleTestCase.assertFormError()` 和 `assertFormsetError()` 将被移除。
- `django.contrib.sessions.serializers.PickleSerializer` 将被移除。
- 不再允许在预取相关对象的查询集上使用未提供 `chunk_size` 参数的 `QuerySet.iterator()` 的用法。
- 不再允许将未保存的模型实例传递给相关过滤器。
- 在 `RemoteUserBackend.configure_user()` 子类的签名中将需要 `created=True`。
- 将移除通过 `GET` 请求在 `django.contrib.auth.views.LogoutView` 和 `django.contrib.auth.views.logout_then_login()` 中注销的支持。
- `django.utils.timezone.utc` 到 `datetime.timezone.utc` 的别名将被移除。
- 不再允许将响应对象和表单/表单集名称传递给 `SimpleTestCase.assertFormError()` 和 `assertFormsetError()`。
- `django.contrib.gis.admin.OpenLayersWidget` 将被移除。
- `django.contrib.auth.hashers.CryptPasswordHasher` 将被移除。
- 将移除模板 `"django/forms/default.html"` 和 `"django/forms/formsets/default.html"`。
- 将移除在 `Expression.asc()` 和 `Expression.desc()` 方法以及 `OrderBy` 表达式中传递 `nulls_first=False` 或 `nulls_last=False` 的能力。

## 4.1

请查看 [Django 3.2 发布说明](/zh-hans/5.2/releases/3.2/#deprecated-features-3-2) 以获取有关这些更改的更多详细信息。

- 将移除在 `TestCase.setUpTestData()` 中将不支持使用 `copy.deepcopy()` 创建深拷贝的对象分配给类属性的支持。
- `BaseCommand.requires_system_checks` 将不再支持布尔值。
- `django.core.validators.EmailValidator` 的 `whitelist` 参数和 `domain_whitelist` 属性将被移除。
- 将移除 `default_app_config` 模块变量。
- `TransactionTestCase.assertQuerysetEqual()` 不再在与字符串值比较时自动调用 `repr()` 来处理查询集。
- `django.core.cache.backends.memcached.MemcachedCache` 将被移除。
- 将移除对 `django.contrib.messages.storage.cookie.CookieStorage` 使用的 Django 3.2 之前的消息格式的支持。

## 4.0

请查看 [Django 3.0 发布说明](/zh-hans/5.2/releases/3.0/#deprecated-features-3-0) 以获取有关这些更改的更多详细信息。

- `django.utils.http.urlquote()`, `urlquote_plus()`, `urlunquote()`, 和 `urlunquote_plus()` 将被移除。
- `django.utils.encoding.force_text()` 和 `smart_text()` 将被移除。
- `django.utils.translation.ugettext()`, `ugettext_lazy()`, `ugettext_noop()`, `ungettext()`, 和 `ungettext_lazy()` 将被移除。
- `django.views.i18n.set_language()` 将不再在 `request.session` 中设置用户语言（键为 `django.utils.translation.LANGUAGE_SESSION_KEY`）。
- 在 `django.db.models.Expression.get_group_by_cols()` 子类的签名中将需要 `alias=None`。
- `django.utils.text.unescape_entities()` 将被移除。
- `django.utils.http.is_safe_url()` 将被移除。

请查看 [Django 3.1 发布说明](/zh-hans/5.2/releases/3.1/#deprecated-features-3-1) 以获取有关这些更改的更多详细信息。

- `PASSWORD_RESET_TIMEOUT_DAYS` 设置将被移除。
- 不再允许在非布尔值作为右操作数的情况下使用未记录的 [`isnull`](/zh-hans/5.2/ref/models/querysets/#std-fieldlookup-isnull) 查询。
- `django.db.models.query_utils.InvalidQuery` 异常类将被移除。
- `django-admin.py` 入口点将被移除。
- `HttpRequest.is_ajax()` 方法将被移除。
- 将移除 `django.contrib.messages.storage.cookie.CookieStorage` 使用的 Django 3.1 之前的 Cookie 值的编码格式的支持。
- 将移除在管理员网站中（使用 SHA-1 哈希算法的） Django 3.1 之前的密码重置令牌的支持。
- 将移除 Django 3.1 之前的会话编码格式的支持。
- 将移除在 Django 3.1 之前（使用 SHA-1 算法编码的） `django.core.signing.Signer` 签名的支持。
- 将移除在 Django 3.1 之前使用 SHA-1 算法编码的 `django.core.signing.dumps()` 签名在 `django.core.signing.loads()` 中的支持。
- 将移除在 Django 3.1 之前（使用 SHA-1 算法的）用户会话的支持。
- `django.utils.deprecation.MiddlewareMixin.__init__()` 的 `get_response` 参数将需要，并且不会接受 `None`。
- `django.dispatch.Signal` 的 `providing_args` 参数将被移除。
- `django.utils.crypto.get_random_string()` 的 `length` 参数将变为必填项。
- `ModelMultipleChoiceField` 中的 `list` 消息将被移除。
- 将移除将原始列别名传递给 `QuerySet.order_by()` 的支持。
- 模型 `NullBooleanField` 将被移除，为了与历史迁移兼容，将保留一个存根字段。
- `django.conf.urls.url()` 将被移除。
- 模型 `django.contrib.postgres.fields.JSONField` 将被移除，为了与历史迁移兼容，将保留一个存根字段。
- `django.contrib.postgres.forms.JSONField`、`django.contrib.postgres.fields.jsonb.KeyTransform` 和 `django.contrib.postgres.fields.jsonb.KeyTextTransform` 将被移除。
- `{% ifequal %}` 和 `{% ifnotequal %}` 模板标签将被移除。
- `DEFAULT_HASHING_ALGORITHM` 过渡设置将被移除。

## 3.1

请查看 [Django 2.2 发布说明](/zh-hans/5.2/releases/2.2/#deprecated-features-2-2) 以获取有关这些更改的更多详细信息。

- `django.utils.timezone.FixedOffset` 将被移除。
- `django.core.paginator.QuerySetPaginator` 将被移除。
- 模型的 `Meta.ordering` 将不再影响 `GROUP BY` 查询。
- `django.contrib.postgres.fields.FloatRangeField` 和 `django.contrib.postgres.forms.FloatRangeField` 将被移除。
- `FILE_CHARSET` 设置将被移除。
- `django.contrib.staticfiles.storage.CachedStaticFilesStorage` 将被移除。
- `RemoteUserBackend.configure_user()` 将要求将 `request` 作为第一个位置参数传递。
- 将移除对 `SimpleTestCase.allow_database_queries` 和 `TransactionTestCase.multi_db` 的支持。

## 3.0

请查看 [Django 2.0 发布说明](/zh-hans/5.2/releases/2.0/#deprecated-features-2-0) 以获取有关这些更改的更多详细信息。

- `django.db.backends.postgresql_psycopg2` 模块将被移除。
- `django.shortcuts.render_to_response()` 将被移除。
- `DEFAULT_CONTENT_TYPE` 设置将被移除。
- `HttpRequest.xreadlines()` 将被移除。
- 将移除对 `Field.from_db_value()` 和 `Expression.convert_value()` 的 `context` 参数的支持。
- `QuerySet.earliest()` 和 `latest()` 的 `field_name` 关键字参数将被移除。

请查看 [Django 2.1 发布说明](/zh-hans/5.2/releases/2.1/#deprecated-features-2-1) 以获取有关这些更改的更多详细信息。

- `django.contrib.gis.db.models.functions.ForceRHR` 将被移除。
- `django.utils.http.cookie_date()` 将被移除。
- `staticfiles` 和 `admin_static` 模板标签库将被移除。
- `django.contrib.staticfiles.templatetags.static()` 将被移除。
- 将移除允许定义 `InlineModelAdmin.has_add_permission()` 时没有 `obj` 参数的兼容性层。

## 2.1

请查看 [Django 1.11 发布说明](/zh-hans/5.2/releases/1.11/#deprecated-features-1-11) 以获取有关这些更改的更多详细信息。

- `contrib.auth.views.login()`, `logout()`, `password_change()`, `password_change_done()`, `password_reset()`, `password_reset_done()`, `password_reset_confirm()`, 和 `password_reset_complete()` 将被移除。
- `contrib.auth.views.logout_then_login()` 的 `extra_context` 参数将被移除。
- `django.test.runner.setup_databases()` 将被移除。
- `django.utils.translation.string_concat()` 将被移除。
- `django.core.cache.backends.memcached.PyLibMCCache` 将不再支持将 `pylibmc` 行为设置作为 `OPTIONS` 的顶级属性传递。
- `django.utils.http.is_safe_url()` 的 `host` 参数将被移除。
- 将移除在渲染 `{% include %}` 模板标签时抑制异常的功能。
- `DatabaseIntrospection.get_indexes()` 将被移除。
- 认证后端的 `authenticate()` 方法将要求将 `request` 作为第一个位置参数传递。
- `django.db.models.permalink()` 装饰器将被移除。
- `USE_ETAGS` 设置将被移除。`CommonMiddleware` 和 `django.utils.cache.patch_response_headers()` 将不再设置 ETags。
- `Model._meta.has_auto_field` 属性将被移除。
- `url()` 对正则表达式组中的内联标志（`(?i)`, `(?L)`, `(?m)`, `(?s)`, 和 `(?u)`）的支持将被移除。
- 将移除没有 `renderer` 参数的 `Widget.render()` 方法的支持。

## 2.0

请查看 [Django 1.9 发布说明](/zh-hans/5.2/releases/1.9/#deprecated-features-1-9) 以获取有关这些更改的更多详细信息。

- `django.dispatch.signals.Signal.disconnect()` 中的 `weak` 参数将被移除。
- `django.db.backends.base.BaseDatabaseOperations.check_aggregate_support()` 将被移除。
- `django.forms.extras` 包将被移除。
- `assignment_tag` 助手将被移除。
- `assertsRedirects` 中的 `host` 参数将被移除。还将移除兼容性层，允许在路径相同的情况下将绝对 URL 视为与相对 URL 相等。
- `Field.rel` 将被移除。
- `Field.remote_field.to` 属性将被移除。
- `ForeignKey` 和 `OneToOneField` 的 `on_delete` 参数将变为必填项。
- `django.db.models.fields.add_lazy_relation()` 将被移除。
- 在启用时区支持时，不再将不支持时区的数据库后端将具有意识到时区的日期时间转换为 UTC 中的不明确值，当这些值作为参数传递给 ORM 之外执行的 SQL 查询，例如，使用 `cursor.execute()` 时。
- `django.contrib.auth.tests.utils.skipIfCustomUser()` 装饰器将被移除。
- `GeoManager` 和 `GeoQuerySet` 类将被移除。
- `django.contrib.gis.geoip` 模块将被移除。
- 模板加载器中的 `supports_recursion` 检查将从以下内容中移除：

  - `django.template.engine.Engine.find_template()`
  - `django.template.loader_tags.ExtendsNode.find_template()`
  - `django.template.loaders.base.Loader.supports_recursion()`
  - `django.template.loaders.cached.Loader.supports_recursion()`
- `load_template()` 和 `load_template_sources()` 模板加载器方法将被移除。
- 模板加载器的 `template_dirs` 参数将被移除：

  - `django.template.loaders.base.Loader.get_template()`
  - `django.template.loaders.cached.Loader.cache_key()`
  - `django.template.loaders.cached.Loader.get_template()`
  - `django.template.loaders.cached.Loader.get_template_sources()`
  - `django.template.loaders.filesystem.Loader.get_template_sources()`
- `django.template.loaders.base.Loader.__call__()` 方法将被移除。
- 将不再支持具有单个位置参数的自定义错误视图。
- `django.utils.feedgenerator.Atom1Feed` 和 `django.utils.feedgenerator.RssFeed` 的 `mime_type` 属性将被移除，而 `content_type` 将取而代之。
- `django.conf.urls.include()` 的 `app_name` 参数将被移除。
- 将移除将 3 元组作为 `include()` 的第一个参数传递的支持。
- 将移除在不设置应用程序命名空间的情况下设置 URL 实例命名空间的支持。
- `Field._get_val_from_obj()` 将被移除，取而代之的是 `Field.value_from_object()`。
- `django.template.loaders.eggs.Loader` 将被移除。
- `contrib.auth` 视图的 `current_app` 参数将被移除。
- `SimpleTestCase.assertRaisesMessage()` 函数的 `callable_obj` 关键字参数将被移除。
- 在 `ModelAdmin` 方法上的 `allow_tags` 属性的支持将被移除。
- `SyndicationFeed.add_item()` 函数的 `enclosure` 关键字参数将被移除。
- `django.template.loader.LoaderOrigin` 和 `django.template.base.StringOrigin` 对于 `django.template.base.Origin` 的别名将被移除。

请查看 [Django 1.10 发布说明](/zh-hans/5.2/releases/1.10/#deprecated-features-1-10) 以获取有关这些更改的更多详细信息。

- `makemigrations --exit` 选项将被移除。
- 将移除直接对反向外键或多对多关系进行赋值的支持。
- `django.contrib.gis.geos.GEOSGeometry` 的 `get_srid()` 和 `set_srid()` 方法将被移除。
- `django.contrib.gis.geos.Point` 的 `get_x()`、`set_x()`、`get_y()`、`set_y()`、`get_z()` 和 `set_z()` 方法将被移除。
- `django.contrib.gis.geos.Point` 的 `get_coords()` 和 `set_coords()` 方法将被移除。
- `django.contrib.gis.geos.MultiPolygon` 的 `cascaded_union` 属性将被移除。
- `django.utils.functional.allow_lazy()` 将被移除。
- `shell --plain` 选项将被移除。
- `django.core.urlresolvers` 模块将被移除。
- 模型 `CommaSeparatedIntegerField` 将被移除。为了与历史迁移兼容性，将保留一个存根字段。
- 模板中 `Context.has_key()` 方法的支持将被移除。
- `django.core.files.storage.Storage` 的 `accessed_time()`、`created_time()` 和 `modified_time()` 方法的支持将被移除。
- 当设置了 `Meta.default_related_name` 时，将移除使用模型名称进行查询查找的支持。
- `__search` 查询查找以及 `DatabaseOperations.fulltext_search_sql()` 方法将被移除。
- 将移除支持自定义相关管理器类但没有 `_apply_rel_filters()` 方法的 shim。
- 将不再支持使用 `User.is_authenticated()` 和 `User.is_anonymous()` 作为方法。
- 将移除 `Model._meta` 的私有属性 `virtual_fields`。
- `Field.contribute_to_class()` 中的私有关键字参数 `virtual_only` 和 `Model._meta.add_field()` 中的 `virtual` 将被移除。
- `javascript_catalog()` 和 `json_catalog()` 视图将被移除。
- `django.contrib.gis.utils.precision_wkt()` 函数将被移除。
- 在多表继承中，隐式将 `OneToOneField` 提升为 `parent_link` 的操作将被移除。
- 将移除对 `Widget._format_value()` 的支持。
- `FileField` 的方法 `get_directory_name()` 和 `get_filename()` 将被移除。
- 将移除 `mark_for_escaping()` 函数及其使用的类：`EscapeData`、`EscapeBytes`、`EscapeText`、`EscapeString` 和 `EscapeUnicode`。
- `escape` 过滤器将更改为使用 `django.utils.html.conditional_escape()`。
- 将移除 `Manager.use_for_related_fields`。
- 模型的 `Manager` 继承将遵循 MRO 继承规则，并且用于选择此行为的 `Meta.manager_inheritance_from_future` 将被移除。
- 将移除对使用 `settings.MIDDLEWARE_CLASSES` 的旧式中间件的支持。

## 1.10

请查看 [Django 1.8 发布说明](/zh-hans/5.2/releases/1.8/#deprecated-features-1-8) 以获取有关这些更改的更多详细信息。

- 将移除直接调用 `SQLCompiler` 作为调用其 `quote_name_unless_alias` 方法的别名的支持。
- `cycle` 和 `firstof` 模板标签将从 `future` 模板标签库中移除（在 1.6/1.7 弃用期间使用）。
- `django.conf.urls.patterns()` 将被移除。
- `django.conf.urls.i18n.i18n_patterns()` 中的 `prefix` 参数支持将被移除。
- `SimpleTestCase.urls` 将被移除。
- 在模板标签 `for` 中使用错误的解包值数量将引发异常，而不会默默失败。
- 将移除使用点分隔的 Python 路径来反向生成 URL 的能力。
- 将移除对 `LOGIN_URL` 和 `LOGIN_REDIRECT_URL` 设置使用点分隔的 Python 路径的能力。
- 对于自定义管理命令，将停止支持 ``optparse`（由 :py:mod:`argparse`` 替代）。
- 类 `django.core.management.NoArgsCommand` 将被移除。请改用默认不接受参数的 [`BaseCommand`](/zh-hans/5.2/howto/custom-management-commands/#django.core.management.BaseCommand)。
- `django.core.context_processors` 模块将被移除。
- `django.db.models.sql.aggregates` 模块将被移除。
- `django.contrib.gis.db.models.sql.aggregates` 模块将被移除。
- 以下是将被移除的 `django.db.sql.query.Query` 的方法和属性：

  - 属性：`aggregates` 和 `aggregate_select` 将被移除。
  - 方法：`add_aggregate`、`set_aggregate_mask` 和 `append_aggregate_mask` 将被移除。
- `django.template.resolve_variable` 将被移除。
- 以下是将从 [`django.db.models.options.Options`](/zh-hans/5.2/ref/models/meta/#django.db.models.options.Options) (`Model._meta`) 中移除的私有 API：

  - `get_field_by_name()`
  - `get_all_field_names()`
  - `get_fields_with_model()`
  - `get_concrete_fields_with_model()`
  - `get_m2m_with_model()`
  - `get_all_related_objects()`
  - `get_all_related_objects_with_model()`
  - `get_all_related_many_to_many_objects()`
  - `get_all_related_m2m_objects_with_model()`
- `django.forms.RegexField` 的 `error_message` 参数将被移除。
- `unordered_list` 过滤器将不再支持旧式列表。
- 将移除对字符串类型的 `view` 参数在 `url()` 中的支持。
- 将移除将 `django.forms.Form._has_changed()` 重命名为 `has_changed()` 的向后兼容 shim。
- `removetags` 模板过滤器将被移除。
- `django.utils.html` 中的 `remove_tags()` 和 `strip_entities()` 函数将被移除。
- `django.contrib.auth.views.password_reset()` 中的 `is_admin_site` 参数将被移除。
- `django.db.models.field.subclassing.SubfieldBase` 将被移除。
- `django.utils.checksums` 将被移除；其功能已包含在 `django-localflavor` 1.1+ 中。
- `django.contrib.admin.helpers.InlineAdminForm` 上的 `original_content_type_id` 属性将被移除。
- 将移除向后兼容的 shim，以允许 `FormMixin.get_form()` 定义时不提供 `form_class` 参数的默认值。
- 以下设置将被移除：

  - `ALLOWED_INCLUDE_ROOTS`
  - `TEMPLATE_CONTEXT_PROCESSORS`
  - `TEMPLATE_DEBUG`
  - `TEMPLATE_DIRS`
  - `TEMPLATE_LOADERS`
  - `TEMPLATE_STRING_IF_INVALID`
- 向后兼容的别名 `django.template.loader.BaseLoader` 将被移除。
- 由 [`get_template()`](/zh-hans/5.2/topics/templates/#django.template.loader.get_template) 和 [`select_template()`](/zh-hans/5.2/topics/templates/#django.template.loader.select_template) 返回的 Django 模板对象将不再在其 [`render()`](/zh-hans/5.2/topics/templates/#django.template.backends.base.Template.render) 方法中接受 [`Context`](/zh-hans/5.2/ref/templates/api/#django.template.Context)。
- [Template response APIs](/zh-hans/5.2/ref/template-response/) 将强制使用 [`dict`](https://docs.python.org/3/library/stdtypes.html#dict) 和依赖于后端的模板对象，而不再使用 [`Context`](/zh-hans/5.2/ref/templates/api/#django.template.Context) 和 [`Template`](/zh-hans/5.2/ref/templates/api/#django.template.Template)。
- 以下函数和类的 `current_app` 参数将被移除：

  - `django.shortcuts.render()`
  - `django.template.Context()`
  - `django.template.RequestContext()`
  - `django.template.response.TemplateResponse()`
- 以下函数的 `dictionary` 和 `context_instance` 参数将被移除：

  - `django.shortcuts.render()`
  - `django.shortcuts.render_to_response()`
  - `django.template.loader.render_to_string()`
- 以下函数的 `dirs` 参数将被移除：

  - `django.template.loader.get_template()`
  - `django.template.loader.select_template()`
  - `django.shortcuts.render()`
  - `django.shortcuts.render_to_response()`
- 会启用会话验证，不管 `'django.contrib.auth.middleware.SessionAuthenticationMiddleware'` 是否在 `MIDDLEWARE_CLASSES` 中。
- 私有属性 `django.db.models.Field.related` 将被移除。
- `migrate` 管理命令的 `--list` 选项将被移除。
- `ssi` 模板标签将被移除。
- 模板标签中的 `if` 不再支持 `=` 比较运算符。
- 将移除允许在没有 `max_length` 参数的情况下定义 `Storage.get_available_name()` 和 `Storage.save()` 的向后兼容 shim。
- 将移除在 `ModelFormMixin.success_url` 中的传统 `%(<foo>)s` 语法支持。
- 将移除 `GeoQuerySet` 的聚合方法 `collect()`, `extent()`, `extent3d()`, `make_line()`, 和 `unionagg()`。
- 将移除在创建内容类型实例时指定 `ContentType.name` 的能力。
- 将移除对旧版 `allow_migrate` 签名的支持。它已从 `allow_migrate(self, db, model)` 更改为 `allow_migrate(self, db, app_label, model_name=None, **hints)`。
- 将移除使用逗号分隔参数的 `{% cycle %}` 语法的支持。
- 当给定无效的分隔符时，[`Signer`](/zh-hans/5.2/topics/signing/#django.core.signing.Signer) 发出的警告将变为异常。

## 1.9

请查看 [Django 1.7 发布说明](/zh-hans/5.2/releases/1.7/#deprecated-features-1-7) 以获取有关这些更改的更多详细信息。

- `django.utils.dictconfig` 将被移除。
- `django.utils.importlib` 将被移除。
- `django.utils.tzinfo` 将被移除。
- `django.utils.unittest` 将被移除。
- `syncdb` 命令将被移除。
- `django.db.models.signals.pre_syncdb` 和 `django.db.models.signals.post_syncdb` 将被移除。
- 在数据库路由器上的 `allow_syncdb` 将不再自动变成 `allow_migrate`。
- 将移除对没有迁移的应用程序的自动同步。除非您向 `migrate` 传递 `--run-syncdb` 选项，否则所有应用程序将成为必须进行迁移。
- 将移除没有迁移的应用程序的 SQL 管理命令，包括 `sql`、`sqlall`、`sqlclear`、`sqldropindexes` 和 `sqlindexes`。
- 将移除对自动加载 `initial_data` 固定数据和初始 SQL 数据的支持。
- 所有模型都需要在一个已安装的应用程序中定义，或者声明一个显式的 [`app_label`](/zh-hans/5.2/ref/models/options/#django.db.models.Options.app_label)。此外，在其应用程序加载之前将无法导入它们。特别是，在其应用程序的根包中将无法导入模型。
- 模型和表单中的 `IPAddressField` 将被移除。为了与历史迁移兼容性，将保留一个存根字段。
- 将不再支持 `AppCommand.handle_app()`。
- 将不再能够从 `django.contrib.sites.models` 导入 `RequestSite` 和 `get_current_site()`。
- 通过 `runfcgi` 管理命令的 FastCGI 支持将被移除。请使用 WSGI 部署您的项目。
- `django.utils.datastructures.SortedDict` 将被移除。请改用 Python 标准库中的 [`collections.OrderedDict`](https://docs.python.org/3/library/collections.html#collections.OrderedDict)。
- `ModelAdmin.declared_fieldsets` 将被移除。
- 在 Django 代码库中，`util.py` 的实例已被重命名为 `utils.py`，以统一所有 util 和 utils 引用。提供向后兼容性的模块将被移除：

  - `django.contrib.admin.util`
  - `django.contrib.gis.db.backends.util`
  - `django.db.backends.util`
  - `django.forms.util`
- `ModelAdmin.get_formsets` 将被移除。
- 将移除为了将 `BaseMemcachedCache._get_memcache_timeout()` 方法重命名为 `get_backend_timeout()` 而引入的向后兼容 shim。
- `--natural` 和 `-n` 选项将被移除，用于 [`dumpdata`](/zh-hans/5.2/ref/django-admin/#django-admin-dumpdata)。
- `serializers.serialize()` 的 `use_natural_keys` 参数将被移除。
- 私有 API `django.forms.forms.get_declared_fields()` 将被移除。
- 将移除使用 `SplitDateTimeWidget` 与 `DateTimeField` 的能力。
- 将移除 `WSGIRequest.REQUEST` 属性。
- 类 `django.utils.datastructures.MergeDict` 将被移除。
- `zh-cn` 和 `zh-tw` 语言代码将被移除，并分别被 `zh-hans` 和 `zh-hant` 语言代码替代。
- 内部的 `django.utils.functional.memoize` 将被移除。
- `django.core.cache.get_cache` 将被移除。请在 [`CACHES`](/zh-hans/5.2/ref/settings/#std-setting-CACHES) 中添加适当的条目，并改用 [`django.core.cache.caches`](/zh-hans/5.2/topics/cache/#django.core.cache.caches)。
- `django.db.models.loading` 将被移除。
- 将不再支持将可调用参数传递给查询集。
- `BaseCommand.requires_model_validation` 将被移除，取而代之的是 `requires_system_checks`。管理验证器将被管理检查取代。
- `ModelAdmin.validator_class` 和 `default_validator_class` 属性将被移除。
- `ModelAdmin.validate()` 将被移除。
- `django.db.backends.DatabaseValidation.validate_field` 将被移除，取而代之的是 `check_field` 方法。
- `validate` 管理命令将被移除。
- `django.utils.module_loading.import_by_path` 将被移除，取而代之的是 `django.utils.module_loading.import_string`。
- ssi\`\`和\`url\`\`模板标签将从\`future\`\`模板标签库中删除(在1.3/1.4弃用期内使用)。
- `django.utils.text.javascript_quote` 将被移除。
- 将不再支持数据库测试设置作为独立的数据库设置条目，以 `TEST_` 为前缀。
- 将移除对 [`ModelChoiceField`](/zh-hans/5.2/ref/forms/fields/#django.forms.ModelChoiceField) 和 [`ModelMultipleChoiceField`](/zh-hans/5.2/ref/forms/fields/#django.forms.ModelMultipleChoiceField) 的 `cache_choices` 选项支持。
- [`RedirectView.permanent`](/zh-hans/5.2/ref/class-based-views/base/#django.views.generic.base.RedirectView.permanent) 属性的默认值将从 `True` 更改为 `False`。
- `django.contrib.sitemaps.FlatPageSitemap` 将被移除，取而代之的是 `django.contrib.flatpages.sitemaps.FlatPageSitemap`。
- 私有 API `django.test.utils.TestTemplateLoader` 将被移除。
- `django.contrib.contenttypes.generic` 模块将被移除。
- 私有 API `django.db.models.sql.where.WhereNode.make_atom()` 和 `django.db.models.sql.where.Constraint` 将被移除。

## 1.8

请查看 [Django 1.6 发布说明](/zh-hans/5.2/releases/1.6/#deprecated-features-1-6) 以获取有关这些更改的更多详细信息。

- `django.contrib.comments` 将被移除。
- 以下事务管理 API 将被移除：

  - `TransactionMiddleware`,
  - 在 `django.db.transaction` 中定义的装饰器和上下文管理器 `autocommit`、`commit_on_success` 和 `commit_manually` 将被移除。
  - 在 `django.db.transaction` 中定义的函数 `commit_unless_managed` 和 `rollback_unless_managed` 也将被移除。
  - `TRANSACTIONS_MANAGED` 设置也将被移除。
- [`cycle`](/zh-hans/5.2/ref/templates/builtins/#std-templatetag-cycle) 和 [`firstof`](/zh-hans/5.2/ref/templates/builtins/#std-templatetag-firstof) 模板标签将自动转义它们的参数。在 1.6 和 1.7 版本中，这一行为由位于 `future` 模板标签库中的这些标签的版本提供。
- `SEND_BROKEN_LINK_EMAILS` 设置将被移除。请将 [`django.middleware.common.BrokenLinkEmailsMiddleware`](/zh-hans/5.2/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware) 中间件添加到你的 `MIDDLEWARE_CLASSES` 设置中。
- `django.middleware.doc.XViewMiddleware` 将被移除。请改用 `django.contrib.admindocs.middleware.XViewMiddleware`。
- `Model._meta.module_name` 已重命名为 `model_name`。
- 移除了用于重命名 `get_query_set` 和类似 queryset 方法的向后兼容的 shims。这影响到以下类：`BaseModelAdmin`、`ChangeList`、`BaseCommentNode`、`GenericForeignKey`、`Manager`、`SingleRelatedObjectDescriptor` 和 `ReverseSingleRelatedObjectDescriptor`。
- 移除了用于重命名属性 `ChangeList.root_query_set` 和 `ChangeList.query_set` 的向后兼容的 shims。
- `django.views.defaults.shortcut` 将被移除，作为从核心 Django 代码库中移除所有 `django.contrib` 引用的目标的一部分。请改用 `django.contrib.contenttypes.views.shortcut`。同时，`django.conf.urls.shortcut` 也将被移除。
- 对于 Python Imaging Library (PIL) 模块的支持将被移除，因为它似乎不再积极维护，并且不支持 Python 3。
- 以下私有 API 将被移除：

  - `django.db.backend`
  - `django.db.close_connection()`
  - `django.db.backends.creation.BaseDatabaseCreation.set_autocommit()`
  - `django.db.transaction.is_managed()`
  - `django.db.transaction.managed()`
- `django.forms.widgets.RadioInput` 将被移除，取而代之的是 `django.forms.widgets.RadioChoiceInput`。
- 模块 `django.test.simple` 和类 `django.test.simple.DjangoTestSuiteRunner` 将被移除。请改用 `django.test.runner.DiscoverRunner`。
- 模块 `django.test._doctest` 将被移除。请改用 Python 标准库中的 doctest 模块。
- `CACHE_MIDDLEWARE_ANONYMOUS_ONLY` 设置将被移除。
- Django 不再在模型或表单层面使用硬编码的 *按住 "Control" 键，或者在 Mac 上按住 "Command" 键以选择多个* 字符串来覆盖或追加到用户提供的 ManyToMany 模型字段的 `help_text`。
- `Model._meta.get_(add|change|delete)_permission` 方法将被移除。
- 会话键 `django_language` 不再读取以保持向后兼容性。
- 地理 Sitemaps 将被移除（`django.contrib.gis.sitemaps.views.index` 和 `django.contrib.gis.sitemaps.views.sitemap`）。
- `django.utils.html.fix_ampersands`、`fix_ampersands` 模板过滤器和 `django.utils.html.clean_html` 将在加速弃用后被移除。

## 1.7

请查看 [Django 1.5 发布说明](/zh-hans/5.2/releases/1.5/#deprecated-features-1-5) 以获取有关这些更改的更多详细信息。

- 模块 `django.utils.simplejson` 将被移除。应该改用标准库中的 [`json`](https://docs.python.org/3/library/json.html#module-json)。
- 函数\`\`django.utils.itercompat.product\`将被删除。应该使用Python内置版本。
- 当INSTALLED\_APPS和TEMPLATE\_DIRS设置被指定为普通字符串而不是元组时，它们的自动更正将被移除并引发异常。
- `mimetype` 参数将被从 [`HttpResponse`](/zh-hans/5.2/ref/request-response/#django.http.HttpResponse)、[`SimpleTemplateResponse`](/zh-hans/5.2/ref/template-response/#django.template.response.SimpleTemplateResponse) 和 [`TemplateResponse`](/zh-hans/5.2/ref/template-response/#django.template.response.TemplateResponse) 的 `__init__` 方法中移除。应该改用 `content_type`。这也适用于 `render_to_response()` 快捷方式以及站点地图视图 [`index()`](/zh-hans/5.2/ref/contrib/sitemaps/#django.contrib.sitemaps.views.index) 和 [`sitemap()`](/zh-hans/5.2/ref/contrib/sitemaps/#django.contrib.sitemaps.views.sitemap)。
- 当使用迭代器实例化 [`HttpResponse`](/zh-hans/5.2/ref/request-response/#django.http.HttpResponse)，或者当将 [`content`](/zh-hans/5.2/ref/request-response/#django.http.HttpResponse.content) 设置为迭代器时，该迭代器将被立即消耗。
- `AUTH_PROFILE_MODULE` 设置以及 User 模型上的 `get_profile()` 方法将被移除。
- cleanup\`\`管理命令将被删除。它被\`\`clearsessions\`\`所取代。
- daily\_cleanup.py 脚本将会被移除。
- `depth` 关键字参数将从 [`select_related()`](/zh-hans/5.2/ref/models/querysets/#django.db.models.query.QuerySet.select_related) 中移除。
- 来自 [`django.test.utils`](/zh-hans/5.2/topics/testing/advanced/#module-django.test.utils) 的未记录文档的 `get_warnings_state()`/`restore_warnings_state()` 函数以及 [django.test.\*TestCase](/zh-hans/5.2/topics/testing/tools/#django-testcase-subclasses) 中的 `save_warnings_state()`/ `restore_warnings_state()` 方法已被弃用。应该使用从 Python 2.6 开始可用的 [`warnings.catch_warnings`](https://docs.python.org/3/library/warnings.html#warnings.catch_warnings) 上下文管理器。
- 在 [`AuthenticationForm`](/zh-hans/5.2/topics/auth/default/#django.contrib.auth.forms.AuthenticationForm) 中未记录的 `check_for_test_cookie` 方法将在加速弃用后被移除。用户子类化这个表单的应该移除对这个方法的调用，并确保他们的身份验证相关视图启用了 CSRF 保护，以确保启用了 cookies。
- 支持 base36 编码用户 ID（`django.contrib.auth.views.password_reset_confirm_uidb36`）的 `django.contrib.auth.views.password_reset_confirm()` 版本将被移除。如果你的站点在 Django 1.6 上运行时间超过了 `PASSWORD_RESET_TIMEOUT_DAYS`，这个更改不会产生影响。如果没有，那么在升级到 Django 1.7 之前生成的任何密码重置链接在升级后将不起作用。
- `django.utils.encoding.StrAndUnicode` 混合类将被移除。

## 1.6

请查看 [Django 1.4 发布说明](/zh-hans/5.2/releases/1.4/#deprecated-features-1-4) 以获取有关这些更改的更多详细信息。

- `django.contrib.databrowse` 将来会被移除。
- `django.contrib.localflavor` 将会被加快移除。
- `django.contrib.markup` 将会被加快移除。
- 兼容性模块 `django.utils.copycompat` 和 `django.utils.hashcompat` 以及函数 `django.utils.itercompat.all` 和 `django.utils.itercompat.any` 将会被移除。应该使用Python内置版本。
- `csrf_response_exempt` 和 `csrf_view_exempt` 装饰器将被删除。 从1.4开始， `csrf_response_exempt` 已成为空操作（它返回相同的功能），而 `csrf_view_exempt` 已成为 `django.views.decorators.csrf.csrf_exempt` 的同义词以取代它。
- 原有缓存后端 `django.core.cache.backends.memcached.CacheClass` 后端在Django 1.3中分为两个，以引入对PyLibMC的支持。历史悠久的 `CacheClass` 将会被删除，取而代之的是缓存后端 `django.core.cache.backends.memcached.MemcachedCache` 。
- `django.contrib.localflavor.uk` 的英国前缀对象只能通过其GB前缀名称来访问（GB是英国的正确ISO 3166代码）。
- `IGNORABLE_404_STARTS` 和 `IGNORABLE_404_ENDS` 设置在 1.4 版本中已被 [`IGNORABLE_404_URLS`](/zh-hans/5.2/ref/settings/#std-setting-IGNORABLE_404_URLS) 取代。它们将被移除。
- 在 1.4 版本中，表单向导已经重构为使用基于类的视图，并具有可插拔的后端。之前的实现将被移除。
- 删除 [`cache_page()`](/zh-hans/5.2/topics/cache/#django.views.decorators.cache.cache_page) 缓存的旧版调用方式。
- 向后兼容的填充程序会自动向 `'mail_admins'` 日志记录处理程序中添加一个debug-false过滤器。 如果需要的话，日志配置 [`LOGGING`](/zh-hans/5.2/ref/settings/#std-setting-LOGGING) 配置应该显式地包括这个过滤器。
- 内置的截断函数 `django.utils.text.truncate_words()` 和 `django.utils.text.truncate_html_words()` 将被移除，取而代之的是 `django.utils.text.Truncator` 类。
- `django.contrib.gis.geoip.GeoIP` 类在 1.4 版本中已移动到 `django.contrib.gis.geoip` 中，`django.contrib.gis.utils` 中的快捷方式将被移除。
- `django.conf.urls.defaults` 将被移除。函数 `include()`, `patterns()`, 和 `url()`，以及 [`handler404`](/zh-hans/5.2/ref/urls/#django.conf.urls.handler404) 和 [`handler500`](/zh-hans/5.2/ref/urls/#django.conf.urls.handler500) 现在可以通过 `django.conf.urls` 使用。
- 函数 `setup_environ()` 和 `execute_manager()` 将从 [`django.core.management`](/zh-hans/5.2/howto/custom-management-commands/#module-django.core.management) 中移除。这也意味着旧的（1.4 版本之前的） `manage.py` 文件的风格将不再起作用。
- 不再支持将 `is_safe` 和 `needs_autoescape` 标志设置为模板过滤器函数的属性。
- 在 1.4 版本中，属性 `HttpRequest.raw_post_data` 已重命名为 `HttpRequest.body`。向后兼容性将被移除，`HttpRequest.raw_post_data` 将不再起作用。
- 在 `ModelAdmin.response_add()` 中，`post_url_continue` 参数的值必须是 ```None``（以重定向到新创建的对象的编辑页面）或预格式化的 URL。不再接受字符串格式，例如之前的默认值 ``'../%s/'```。

## 1.5

请查看 [Django 1.3 发布说明](/zh-hans/5.2/releases/1.3/#deprecated-features-1-3) 以获取有关这些更改的更多详细信息。

- 启动没有 [`SECRET_KEY`](/zh-hans/5.2/ref/settings/#std-setting-SECRET_KEY) 的 Django 将引发异常而不是 `DeprecationWarning`。这是从通常的弃用路径加速过来的（参见 [Django 1.4 发布说明](/zh-hans/5.2/releases/1.4/)）。
- `mod_python` 请求处理程序将被移除。应该改用 `mod_wsgi` 处理程序。
- `django.test.client.Response` 对象上的 `template` 属性将被移除。应该改用 [`templates`](/zh-hans/5.2/topics/testing/tools/#django.test.Response.templates) 属性。
- `django.test.simple.DjangoTestRunner` 将被移除。而应该使用 `unittest` 的原生类。`django.test.simple.DjangoTestRunner` 的功能（包括快速失败和 Ctrl-C 测试终止）可以由 [`unittest.TextTestRunner`](https://docs.python.org/3/library/unittest.html#unittest.TextTestRunner) 提供。
- 未记录的函数 `django.contrib.formtools.utils.security_hash` 将被移除，应该改用 `django.contrib.formtools.utils.form_hmac`。
- 基于函数的通用视图模块将被移除，应该使用它们的基于类的等效模块，详情请参考 [这里](/zh-hans/5.2/topics/class-based-views/)。
- `django.core.servers.basehttp.AdminMediaHandler` 将被移除。取而代之的是使用 `django.contrib.staticfiles.handlers.StaticFilesHandler`。
- 模板标签库 `adminmedia` 和模板标签 `{% admin_media_prefix %}` 将被移除，取而代之的是通用的静态文件处理方式。（这比通常的弃用路径更快，参见 [Django 1.4 发布说明](/zh-hans/5.2/releases/1.4/)。）
- `url` 和 `ssi` 模板标签将被修改，使每个标签的第一个参数是一个模板变量，而不是隐含的字符串。在 1.4 版本中，这个行为由 `future` 模板标签库中的标签版本提供。
- `reset` 和 `sqlreset` 管理命令将被移除。
- 身份验证后端需要支持将非活动用户传递给处理权限的所有方法。不再检查 `supports_inactive_user` 属性，并且可以从自定义后端中移除。
- 在没有 SRID 值的几何体上调用 [`transform()`](/zh-hans/5.2/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry.transform) 将引发 [`GEOSException`](/zh-hans/5.2/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSException)。
- `django.http.CompatCookie` 将被移除，应该使用 `django.http.SimpleCookie`。
- `django.core.context_processors.PermWrapper` 和 `django.core.context_processors.PermLookupDict` 将被移除，分别应该使用相应的 `django.contrib.auth.context_processors.PermWrapper` 和 `django.contrib.auth.context_processors.PermLookupDict`。
- [`MEDIA_URL`](/zh-hans/5.2/ref/settings/#std-setting-MEDIA_URL) 或 [`STATIC_URL`](/zh-hans/5.2/ref/settings/#std-setting-STATIC_URL) 设置将需要以斜杠结尾，以确保在模板中有一种一致的方法来组合路径。
- `django.db.models.fields.URLField.verify_exists` 将被移除。由于难以解决的安全和性能问题，该功能在 1.3.1 版本中已被弃用，并将遵循略微加速的弃用时间表。
- 在运行时进行的翻译构建过程中，位于所谓的 *项目路径* 下的翻译将被忽略。可以使用 [`LOCALE_PATHS`](/zh-hans/5.2/ref/settings/#std-setting-LOCALE_PATHS) 设置执行相同的任务，其中包括非应用程序特定翻译的文件系统路径，该路径包含在其值中的 `locale` 目录中。
- Markup contrib 应用程序将不再支持早于 2.1 版本的 Python-Markdown 库。由于这是与安全性相关的弃用，采用了加速的时间表。
- `CACHE_BACKEND` 设置将被移除。缓存后端应该在 [`CACHES`](/zh-hans/5.2/ref/settings/#std-setting-CACHES) 设置中指定。

## 1.4

请查看 [Django 1.2 发布说明](/zh-hans/5.2/releases/1.2/#deprecated-features-1-2) 以获取有关这些更改的更多详细信息。

- `CsrfResponseMiddleware` 和 `CsrfMiddleware` 将被移除。要启用 CSRF 保护，请在表单内使用 `{% csrf_token %}` 模板标签。`CsrfViewMiddleware` 仍然存在并且默认启用。
- CSRF 功能的旧导入（`django.contrib.csrf.*`）已在 1.2 版本中移动到核心，它们将被移除。
- `django.contrib.gis.db.backend` 模块将被移除，取而代之的是特定的后端模块。
- `SMTPConnection` 将被移除，取而代之的是通用的电子邮件后端 API。
- 数据库后端上的许多对多 SQL 生成函数将被移除。
- 使用 `DATABASE_*` 顶级设置来定义数据库连接的能力将被移除。
- 使用简写符号来指定数据库后端（例如，`sqlite3` 而不是 `django.db.backends.sqlite3`）的能力将被移除。
- `get_db_prep_save`、`get_db_prep_value` 和 `get_db_prep_lookup` 方法将需要支持多个数据库。
- `Message` 模型（位于 `django.contrib.auth` 中），在 `User` 模型中的相关管理器（`user.message_set`），以及相关的方法（`user.message_set.create()` 和 `user.get_and_delete_messages()`）将被移除。应该改用 [消息框架](/zh-hans/5.2/ref/contrib/messages/)。由身份验证上下文处理器返回的相关 `messages` 变量也将被移除。请注意，这意味着管理员应用程序将依赖于消息上下文处理器。
- 身份验证后端需要支持 `obj` 参数以进行权限检查。不再检查 `supports_object_permissions` 属性，可以从自定义后端中移除。
- 身份验证后端需要支持将 `AnonymousUser` 类传递给所有处理权限的方法。不再检查 `supports_anonymous_user` 变量，可以从自定义后端中移除。
- 指定可调用模板加载器而不是 `Loader` 类的能力将被移除，同时为了向后兼容性而包括在内置模板加载器中的 `load_template_source` 函数也将被移除。
- `django.utils.translation.get_date_formats()` 和 `django.utils.translation.get_partial_date_formats()`。这些函数将被移除；使用区域设置感知的 `django.utils.formats.get_format()` 来获取适当的格式。
- 在 `django.forms.fields` 中，常量：`DEFAULT_DATE_INPUT_FORMATS`、`DEFAULT_TIME_INPUT_FORMATS` 和 `DEFAULT_DATETIME_INPUT_FORMATS` 将被移除。使用 `django.utils.formats.get_format()` 来获取适当的格式。
- 将移除使用基于函数的测试运行器的能力，以及 `django.test.simple.run_tests()` 测试运行器。
- `django.contrib.syndication` 中的 `views.feed()` 视图和 `feeds.Feed` 类将被移除。应该改用基于类的视图 `views.Feed`。
- `django.core.context_processors.auth` 将被移除。此版本将移除旧方法，支持新方法 `django.contrib.auth.context_processors.auth`。
- `postgresql` 数据库后端将被移除，应该改用 `postgresql_psycopg2` 后端。
- `no` 语言代码将被移除，已被 `nb` 语言代码替代。
- 身份验证后端需要定义布尔属性 `supports_inactive_user`，直到版本 1.5，届时将假定所有后端都能处理非活动用户。
- `django.db.models.fields.XMLField` 将被移除。这在 1.3 版本中已被弃用。由于自从移除了 `oldforms` 后，该字段没有扮演任何角色，因此采用了加速的弃用时间表。所有使用 `XMLField` 的地方可以替换为 `TextField`。
- `django.core.files.storage.Storage` （和其子类）的 `open()` 方法的未记录的 `mixin` 参数将被移除。

## 1.3

请查看 [Django 1.1 发布说明](/zh-hans/5.2/releases/1.1/#deprecated-features-1-1) 以获取有关这些更改的更多详细信息。

- `AdminSite.root()` 方法将被移除，应该使用包含 `admin.site.urls` 的方式来连接管理页面的URL。
- 身份验证后端需要在 1.4 版本之前定义布尔属性 `supports_object_permissions` 和 `supports_anonymous_user`，在此之后，将假定所有后端都支持这些选项。
