django.utils.encoding.force_text()和smart_text()的别名被弃用。如果您的代码支持Python 2,smart_str()并且 force_str()在此处有所不同,请忽略此弃用。
django.utils.http.urlquote(),urlquote_plus(),urlunquote(),并 urlunquote_plus()在赞成不赞成使用的功能,他们正在别名:urllib.parse.quote(),quote_plus(), unquote(),和unquote_plus()。django.utils.translation.ugettext(),ugettext_lazy(), ugettext_noop(),ungettext(),并ungettext_lazy()在赞成不赞成使用的功能,他们正在别名: django.utils.translation.gettext(), gettext_lazy(), gettext_noop(), ngettext(),和 ngettext_lazy()。django.views.i18n.set_language()将停止在Django 4.0中的会话中设置用户的语言。从Django 2.1开始,该语言始终存储在LANGUAGE_COOKIE_NAMEcookie中。django.utils.text.unescape_entities()不推荐使用 html.unescape()。请注意,与不同unescape_entities(),它会 html.unescape()立即评估惰性字符串。is_safe_url()重命名为 url_has_allowed_host_and_scheme()。URL具有允许的主机和方案,通常并不表示其“安全”。例如,它可能仍然引用不正确。确保还在iri_to_uri()不可信URL的路径组件上使用 。这些功能已到弃用周期的尽头,并已在Django 3.0中删除。
有关这些更改的详细信息,请参阅2.0中不推荐使用的功能,包括如何删除对这些功能的使用。
django.db.backends.postgresql_psycopg2模块已卸下。django.shortcuts.render_to_response() 已移除。DEFAULT_CONTENT_TYPE设置将被删除。HttpRequest.xreadlines() 已移除。context的论据Field.from_db_value()和 Expression.convert_value()被删除。field_name的关键字参数QuerySet.earliest()和 latest()被去除。有关这些更改的详细信息,请参阅2.1中不推荐使用的功能,包括如何删除对这些功能的使用。
ForceRHRGIS功能被删除。django.utils.http.cookie_date() 已移除。staticfiles和admin_static模板标签库被删除。django.contrib.staticfiles.templatetags.staticfiles.static() 已移除。原文:https://www.cnblogs.com/worldinmyeyes/p/12018229.html