Django 3.0 is not recommended and has removed features

3.0 is not recommended to use features

django.utils.encoding.force_text()Andsmart_text() alias is deprecated. If your code supports Python 2, smart_str()and  force_str()is different here, please ignore this abandoned.

Miscellaneous

  • django.utils.http.urlquote(), urlquote_plus(), urlunquote(), And  urlunquote_plus()in favor of deprecated features, they are Alias: , ,  , and .urllib.parse.quote()quote_plus()unquote()unquote_plus()
  • django.utils.translation.ugettext(), ugettext_lazy()ugettext_noop(), ungettext(), And ungettext_lazy()in favor of deprecated features, they are Alias:  , ,  , and  .django.utils.translation.gettext()gettext_lazy()gettext_noop()ngettext()ngettext_lazy()
  • In order to limit the creation of the session and therefore support some caching strategy,  it will stop setting the user's session in Django 4.0 in the language. Starting Django 2.1, the language is always stored in a cookie.django.views.i18n.set_language()LANGUAGE_COOKIE_NAME
  • django.utils.text.unescape_entities()Not recommended  . Please note that different , it will  immediately assess inert strings.html.unescape()unescape_entities()html.unescape()
  • To avoid confusion in terms of the effective range, the dedicated internal utility is_safe_url()renamed  url_has_allowed_host_and_scheme(). URL has allowed host and program, it usually does not mean "safe." For example, it may still be incorrect references. Also make sure the URL path component can not be trusted to use  .iri_to_uri()

3.0 Delete functions

These features have been abandoned to the end of the cycle, and has been removed in Django 3.0 in.

About more information about these changes, please refer to 2.0 is not recommended to use features, including how to remove the use of these functions.

  • The django.db.backends.postgresql_psycopg2module is removed.
  • django.shortcuts.render_to_response() It has been removed.
  • The DEFAULT_CONTENT_TYPEsettings will be deleted.
  • HttpRequest.xreadlines() It has been removed.
  • In support of contextthe argument Field.from_db_value()and  Expression.convert_value()is deleted.
  • The field_namekeyword parameter QuerySet.earliest()and  latest()is removed.

About more information about these changes, please refer to 2.1 is not recommended to use features, including how to remove the use of these functions.

  • The ForceRHRGIS functionality is removed.
  • django.utils.http.cookie_date() It has been removed.
  • In staticfilesand admin_staticis deleted template tag library.
  • django.contrib.staticfiles.templatetags.staticfiles.static() It has been removed.

Guess you like

Origin www.cnblogs.com/worldinmyeyes/p/12018229.html