• 3.1
  • 5.0
  • 6.1
  • Версия документации: 3.2

Хронология депрекации (устаревания) Django

В этом документе описывается, когда различные части Django будут удалены или изменены обратно несовместимым образом после их устаревания в соответствии с :ref:` политикой депрекации <internal-release-deprecation-policy>`. Более подробную информацию о каждом элементе часто можно найти в заметках о выпуске двух предыдущих версий.

4.1

См. Django 3.2 примечания к выпуску для получения более подробной информации об этих изменениях.

  • Support for assigning objects which don’t support creating deep copies with copy.deepcopy() to class attributes in TestCase.setUpTestData() будет удален.

  • BaseCommand.requires_system_checks не будет поддерживать boolean values.

  • The whitelist argument and domain_whitelist attribute of django.core.validators.EmailValidator будет удален.

  • The default_app_config module variable будет удален.

  • TransactionTestCase.assertQuerysetEqual() больше не будет automatically call repr() on a queryset when compared to string values.

  • django.core.cache.backends.memcached.MemcachedCache будет удален.

  • Support for the pre-Django 3.2 format of messages used by django.contrib.messages.storage.cookie.CookieStorage будет удален.

4.0

См. Django 3.0 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.utils.http.urlquote(), urlquote_plus(), urlunquote(), and urlunquote_plus() будет удален.

  • django.utils.encoding.force_text() and smart_text() будет удален.

  • django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy() будет удален.

  • django.views.i18n.set_language() больше не будет set the user language in request.session (key django.utils.translation.LANGUAGE_SESSION_KEY).

  • alias=None будет обязательным in the signature of django.db.models.Expression.get_group_by_cols() subclasses.

  • django.utils.text.unescape_entities() будет удален.

  • django.utils.http.is_safe_url() будет удален.

См. Django 3.1 примечания к выпуску для получения более подробной информации об этих изменениях.

  • The PASSWORD_RESET_TIMEOUT_DAYS setting будет удален.

  • The undocumented usage of the isnull lookup with non-boolean values as the right-hand side больше не будет be allowed.

  • The django.db.models.query_utils.InvalidQuery exception class будет удален.

  • The django-admin.py entry point будет удален.

  • The HttpRequest.is_ajax() метод будет удален.

  • Support for the pre-Django 3.1 encoding format of cookies values used by django.contrib.messages.storage.cookie.CookieStorage будет удален.

  • Support for the pre-Django 3.1 password reset tokens in the admin site (that use the SHA-1 hashing algorithm) будет удален.

  • Support for the pre-Django 3.1 encoding format of sessions будет удален.

  • Support for the pre-Django 3.1 django.core.signing.Signer signatures (encoded with the SHA-1 algorithm) будет удален.

  • Support for the pre-Django 3.1 django.core.signing.dumps() signatures (encoded with the SHA-1 algorithm) in django.core.signing.loads() будет удален.

  • Support for the pre-Django 3.1 user sessions (that use the SHA-1 algorithm) будет удален.

  • The get_response argument for django.utils.deprecation.MiddlewareMixin.__init__() будет обязательным and won’t accept None.

  • The providing_args argument for django.dispatch.Signal будет удален.

  • The length argument for django.utils.crypto.get_random_string() будет обязательным.

  • The list message for ModelMultipleChoiceField будет удален.

  • Support for passing raw column aliases to QuerySet.order_by() будет удален.

  • The model NullBooleanField будет удален. A stub field will remain for compatibility with historical migrations.

  • django.conf.urls.url() будет удален.

  • The model django.contrib.postgres.fields.JSONField будет удален. A stub field will remain for compatibility with historical migrations.

  • django.contrib.postgres.forms.JSONField, django.contrib.postgres.fields.jsonb.KeyTransform, and django.contrib.postgres.fields.jsonb.KeyTextTransform будет удален.

  • The {% ifequal %} and {% ifnotequal %} template tags будет удален.

  • The DEFAULT_HASHING_ALGORITHM transitional setting будет удален.

3.1

См. Django 2.2 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.utils.timezone.FixedOffset будет удален.

  • django.core.paginator.QuerySetPaginator будет удален.

  • A model’s Meta.ordering больше не будет affect GROUP BY queries.

  • django.contrib.postgres.fields.FloatRangeField and django.contrib.postgres.forms.FloatRangeField будет удален.

  • The FILE_CHARSET setting будет удален.

  • django.contrib.staticfiles.storage.CachedStaticFilesStorage будет удален.

  • RemoteUserBackend.configure_user() will require request as the first positional argument.

  • Support for SimpleTestCase.allow_database_queries and TransactionTestCase.multi_db будет удален.

3.0

См. Django 2.0 примечания к выпуску для получения более подробной информации об этих изменениях.

  • The django.db.backends.postgresql_psycopg2 module будет удален.

  • django.shortcuts.render_to_response() будет удален.

  • The DEFAULT_CONTENT_TYPE setting будет удален.

  • HttpRequest.xreadlines() будет удален.

  • Support for the context argument of Field.from_db_value() and Expression.convert_value() будет удален.

  • The field_name keyword argument of QuerySet.earliest() and latest() будет удален.

См. Django 2.1 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.contrib.gis.db.models.функцияs.ForceRHR будет удален.

  • django.utils.http.cookie_date() будет удален.

  • The staticfiles and admin_static template tag libraries будет удален.

  • django.contrib.staticfiles.templatetags.static() будет удален.

  • The shim to allow InlineModelAdmin.has_add_permission() to be defined without an obj argument будет удален.

2.1

См. Django 1.11 примечания к выпуску для получения более подробной информации об этих изменениях.

  • contrib.auth.views.login(), logout(), password_change(), password_change_done(), password_reset(), password_reset_done(), password_reset_confirm(), and password_reset_complete() будет удален.

  • The extra_context parameter of contrib.auth.views.logout_then_login() будет удален.

  • django.test.runner.setup_databases() будет удален.

  • django.utils.translation.string_concat() будет удален.

  • django.core.cache.backends.memcached.PyLibMCCache больше не будет support passing pylibmc behavior settings as top-level attributes of OPTIONS.

  • The host parameter of django.utils.http.is_safe_url() будет удален.

  • Silencing of exceptions raised while rendering the {% include %} template tag будет удален.

  • DatabaseIntrospection.get_indexes() будет удален.

  • The authenticate() метод of authentication backends will require request as the first positional argument.

  • The django.db.models.permalink() decorator будет удален.

  • The USE_ETAGS setting будет удален. CommonMiddleware and django.utils.cache.patch_response_headers() больше не будет set ETags.

  • The Model._meta.has_auto_field attribute будет удален.

  • url()“s поддержка inline flags in regular expression groups ((?i), (?L), (?m), (?s), and (?u)) будет удален.

  • Support for Widget.render() методs without the renderer argument будет удален.

2.0

См. Django 1.9 примечания к выпуску для получения более подробной информации об этих изменениях.

  • The weak argument to django.dispatch.signals.Signal.disconnect() будет удален.

  • django.db.backends.base.BaseDatabaseOperations.check_aggregate_support() будет удален.

  • The django.forms.extras package будет удален.

  • The assignment_tag helper будет удален.

  • The host argument to assertsRedirects будет удален. The compatibility layer which allows absolute URLs to be considered equal to relative ones when the path is identical will also be removed.

  • Field.rel будет удален.

  • Field.remote_field.to attribute будет удален.

  • The on_delete argument for ForeignKey and OneToOneField будет обязательным.

  • django.db.models.fields.add_lazy_relation() будет удален.

  • When time zone support is enabled, database backends that don’t support time zones won’t convert aware datetimes to naive values in UTC anymore when such values are passed as parameters to SQL queries executed outside of the ORM, e.g. with cursor.execute().

  • The django.contrib.auth.tests.utils.skipIfCustomUser() decorator будет удален.

  • The GeoManager and GeoQuerySet classes будет удален.

  • The django.contrib.gis.geoip module будет удален.

  • The supports_recursion check for template loaders будет удален from:

    • 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()

  • The load_template() and load_template_sources() template loader методs будет удален.

  • The template_dirs argument for template loaders будет удален:

    • 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()

  • The django.template.loaders.base.Loader.__call__() метод будет удален.

  • Support for custom error views with a single positional parameter will be dropped.

  • The mime_type attribute of django.utils.feedgenerator.Atom1Feed and django.utils.feedgenerator.RssFeed будет удален in favor of content_type.

  • The app_name argument to django.conf.urls.include() будет удален.

  • Support for passing a 3-tuple as the first argument to include() будет удален.

  • Support for setting a URL instance namespace without an application namespace будет удален.

  • Field._get_val_from_obj() будет удален in favor of Field.value_from_object().

  • django.template.loaders.eggs.Loader будет удален.

  • The current_app parameter to the contrib.auth views будет удален.

  • The callable_obj keyword argument to SimpleTestCase.assertRaisesMessage() будет удален.

  • Support for the allow_tags attribute on ModelAdmin методs будет удален.

  • The enclosure keyword argument to SyndicationFeed.add_item() будет удален.

  • The django.template.loader.LoaderOrigin and django.template.base.StringOrigin aliases for django.template.base.Origin будет удален.

См. Django 1.10 примечания к выпуску для получения более подробной информации об этих изменениях.

  • The makemigrations --exit option будет удален.

  • Support for direct assignment to a reverse foreign key or many-to-many relation будет удален.

  • The get_srid() and set_srid() методs of django.contrib.gis.geos.GEOSGeometry будет удален.

  • The get_x(), set_x(), get_y(), set_y(), get_z(), and set_z() методs of django.contrib.gis.geos.Point будет удален.

  • The get_coords() and set_coords() методs of django.contrib.gis.geos.Point будет удален.

  • The cascaded_union property of django.contrib.gis.geos.MultiPolygon будет удален.

  • django.utils.функцияal.allow_lazy() будет удален.

  • The shell --plain option будет удален.

  • The django.core.urlresolvers module будет удален.

  • The model CommaSeparatedIntegerField будет удален. A stub field will remain for compatibility with historical migrations.

  • Support for the template Context.has_key() метод будет удален.

  • Support for the django.core.files.storage.Storage.accessed_time(), created_time(), and modified_time() методs будет удален.

  • Support for query lookups using the model name when Meta.default_related_name is set будет удален.

  • The __search query lookup and the DatabaseOperations.fulltext_search_sql() метод будет удален.

  • The shim for supporting custom related manager classes without a _apply_rel_filters() метод будет удален.

  • Using User.is_authenticated() and User.is_anonymous() as методs больше не будет be supported.

  • The private attribute virtual_fields of Model._meta будет удален.

  • The private keyword arguments virtual_only in Field.contribute_to_class() and virtual in Model._meta.add_field() будет удален.

  • The javascript_catalog() and json_catalog() views будет удален.

  • The django.contrib.gis.utils.precision_wkt() функция будет удален.

  • In multi-table inheritance, implicit promotion of a OneToOneField to a parent_link будет удален.

  • Support for Widget._format_value() будет удален.

  • FileField методs get_directory_name() and get_filename() будет удален.

  • The mark_for_escaping() функция and the classes it uses: EscapeData, EscapeBytes, EscapeText, EscapeString, and EscapeUnicode будет удален.

  • The escape filter изменится to use django.utils.html.conditional_escape().

  • Manager.use_for_related_fields будет удален.

  • Model Manager inheritance will follow MRO inheritance rules and the Meta.manager_inheritance_from_future to opt-in to this behavior будет удален.

  • Support for old-style middleware using settings.MIDDLEWARE_CLASSES будет удален.

1.10

См. Django 1.8 примечания к выпуску для получения более подробной информации об этих изменениях.

  • Support for calling a SQLCompiler directly as an alias for calling its quote_name_unless_alias метод будет удален.

  • cycle and firstof template tags будет удален from the future template tag library (used during the 1.6/1.7 deprecation period).

  • django.conf.urls.patterns() будет удален.

  • Support for the prefix argument to django.conf.urls.i18n.i18n_patterns() будет удален.

  • SimpleTestCase.urls будет удален.

  • Using an incorrect count of unpacked values in the for template tag will raise an exception rather than fail silently.

  • The ability to reverse URLs using a dotted Python path будет удален.

  • The ability to use a dotted Python path for the LOGIN_URL and LOGIN_REDIRECT_URL settings будет удален.

  • Support for optparse will be dropped for custom management commands (replaced by argparse).

  • The class django.core.management.NoArgsCommand будет удален. Use BaseCommand instead, which takes no arguments by default.

  • django.core.context_processors module будет удален.

  • django.db.models.sql.aggregates module будет удален.

  • django.contrib.gis.db.models.sql.aggregates module будет удален.

  • The following методs and properties of django.db.sql.query.Query будет удален:

    • Properties: aggregates and aggregate_select

    • Methods: add_aggregate, set_aggregate_mask, and append_aggregate_mask.

  • django.template.resolve_variable будет удален.

  • The following private APIs будет удален from django.db.models.options.Options (Model._meta):

    • 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()

  • The error_message argument of django.forms.RegexField будет удален.

  • The unordered_list filter больше не будет support old style lists.

  • Support for string view arguments to url() будет удален.

  • The backward compatible shim to rename django.forms.Form._has_changed() to has_changed() будет удален.

  • The removetags template filter будет удален.

  • The remove_tags() and strip_entities() функцияs in django.utils.html будет удален.

  • The is_admin_site argument to django.contrib.auth.views.password_reset() будет удален.

  • django.db.models.field.subclassing.SubfieldBase будет удален.

  • django.utils.checksums будет удален; its функцияality is included in django-localflavor 1.1+.

  • The original_content_type_id attribute on django.contrib.admin.helpers.InlineAdminForm будет удален.

  • The backwards compatibility shim to allow FormMixin.get_form() to be defined with no default value for its form_class argument будет удален.

  • The following settings будет удален:

    • ALLOWED_INCLUDE_ROOTS

    • TEMPLATE_CONTEXT_PROCESSORS

    • TEMPLATE_DEBUG

    • TEMPLATE_DIRS

    • TEMPLATE_LOADERS

    • TEMPLATE_STRING_IF_INVALID

  • The backwards compatibility alias django.template.loader.BaseLoader будет удален.

  • Django template objects returned by get_template() and select_template() won’t accept a Context in their render() метод anymore.

  • Template response APIs will enforce the use of dict and backend-dependent template objects instead of Context and Template respectively.

  • The current_app parameter for the following функция and classes будет удален:

    • django.shortcuts.render()

    • django.template.Context()

    • django.template.RequestContext()

    • django.template.response.TemplateResponse()

  • The dictionary and context_instance parameters for the following функцияs будет удален:

    • django.shortcuts.render()

    • django.shortcuts.render_to_response()

    • django.template.loader.render_to_string()

  • The dirs parameter for the following функцияs будет удален:

    • django.template.loader.get_template()

    • django.template.loader.select_template()

    • django.shortcuts.render()

    • django.shortcuts.render_to_response()

  • Session verification will be enabled regardless of whether or not 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' is in MIDDLEWARE_CLASSES.

  • Private attribute django.db.models.Field.related будет удален.

  • The --list option of the migrate management command будет удален.

  • The ssi template tag будет удален.

  • Support for the = comparison operator in the if template tag будет удален.

  • The backwards compatibility shims to allow Storage.get_available_name() and Storage.save() to be defined without a max_length argument будет удален.

  • Support for the legacy %(<foo>)s syntax in ModelFormMixin.success_url будет удален.

  • GeoQuerySet aggregate методs collect(), extent(), extent3d(), make_line(), and unionagg() будет удален.

  • Ability to specify ContentType.name when creating a content type instance будет удален.

  • Support for the old signature of allow_migrate будет удален. It changed from allow_migrate(self, db, model) to allow_migrate(self, db, app_label, model_name=None, **hints).

  • Support for the syntax of {% cycle %} that uses comma-separated arguments будет удален.

  • The warning that Signer issues when given an invalid separator will become an exception.

1.9

См. Django 1.7 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.utils.dictconfig будет удален.

  • django.utils.importlib будет удален.

  • django.utils.tzinfo будет удален.

  • django.utils.unittest будет удален.

  • The syncdb command будет удален.

  • django.db.models.signals.pre_syncdb and django.db.models.signals.post_syncdb будет удален.

  • allow_syncdb on database routers больше не будет automatically become allow_migrate.

  • Automatic syncing of apps without migrations будет удален. Migrations will become compulsory for all apps unless you pass the --run-syncdb option to migrate.

  • The SQL management commands for apps without migrations, sql, sqlall, sqlclear, sqldropindexes, and sqlindexes, будет удален.

  • Support for automatic loading of initial_data fixtures and initial SQL data будет удален.

  • All models will need to be defined inside an installed application or declare an explicit app_label. Furthermore, it won’t be possible to import them before their application is loaded. In particular, it won’t be possible to import models inside the root package of their application.

  • The model and form IPAddressField будет удален. A stub field will remain for compatibility with historical migrations.

  • AppCommand.handle_app() больше не будет be supported.

  • RequestSite and get_current_site() больше не будет be importable from django.contrib.sites.models.

  • FastCGI support via the runfcgi management command будет удален. Please deploy your project using WSGI.

  • django.utils.datastructures.SortedDict будет удален. Use collections.OrderedDict from the Python standard library instead.

  • ModelAdmin.declared_fieldsets будет удален.

  • Instances of util.py in the Django codebase have been renamed to utils.py in an effort to unify all util and utils references. The modules that provided backwards compatibility будет удален:

    • django.contrib.admin.util

    • django.contrib.gis.db.backends.util

    • django.db.backends.util

    • django.forms.util

  • ModelAdmin.get_formsets будет удален.

  • The backward compatibility shim introduced to rename the BaseMemcachedCache._get_memcache_timeout() метод to get_backend_timeout() будет удален.

  • The --natural and -n options for dumpdata будет удален.

  • The use_natural_keys argument for serializers.serialize() будет удален.

  • Private API django.forms.forms.get_declared_fields() будет удален.

  • The ability to use a SplitDateTimeWidget with DateTimeField будет удален.

  • The WSGIRequest.REQUEST property будет удален.

  • The class django.utils.datastructures.MergeDict будет удален.

  • The zh-cn and zh-tw language codes будет удален and have been replaced by the zh-hans and zh-hant language code respectively.

  • The internal django.utils.функцияal.memoize будет удален.

  • django.core.cache.get_cache будет удален. Add suitable entries to CACHES and use django.core.cache.caches instead.

  • django.db.models.loading будет удален.

  • Passing callable arguments to querysets больше не будет be possible.

  • BaseCommand.requires_model_validation будет удален in favor of requires_system_checks. Admin validators will be replaced by admin checks.

  • The ModelAdmin.validator_class and default_validator_class attributes будет удален.

  • ModelAdmin.validate() будет удален.

  • django.db.backends.DatabaseValidation.validate_field будет удален in favor of the check_field метод.

  • The validate management command будет удален.

  • django.utils.module_loading.import_by_path будет удален in favor of django.utils.module_loading.import_string.

  • ssi and url template tags будет удален from the future template tag library (used during the 1.3/1.4 deprecation period).

  • django.utils.text.javascript_quote будет удален.

  • Database test settings as independent entries in the database settings, prefixed by TEST_, больше не будет be supported.

  • The cache_choices option to ModelChoiceField and ModelMultipleChoiceField будет удален.

  • The default value of the RedirectView.permanent attribute изменится from True to False.

  • django.contrib.sitemaps.FlatPageSitemap будет удален in favor of django.contrib.flatpages.sitemaps.FlatPageSitemap.

  • Private API django.test.utils.TestTemplateLoader будет удален.

  • The django.contrib.contenttypes.generic module будет удален.

  • Private APIs django.db.models.sql.where.WhereNode.make_atom() and django.db.models.sql.where.Constraint будет удален.

1.8

См. Django 1.6 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.contrib.comments будет удален.

  • The following transaction management APIs будет удален:

    • TransactionMiddleware,

    • the decorators and context managers autocommit, commit_on_success, and commit_manually, defined in django.db.transaction,

    • the функцияs commit_unless_managed and rollback_unless_managed, also defined in django.db.transaction,

    • the TRANSACTIONS_MANAGED setting.

  • The cycle and firstof template tags will auto-escape their arguments. In 1.6 and 1.7, this behavior is provided by the version of these tags in the future template tag library.

  • The SEND_BROKEN_LINK_EMAILS setting будет удален. Add the django.middleware.common.BrokenLinkEmailsMiddleware middleware to your MIDDLEWARE_CLASSES setting instead.

  • django.middleware.doc.XViewMiddleware будет удален. Use django.contrib.admindocs.middleware.XViewMiddleware instead.

  • Model._meta.module_name was renamed to model_name.

  • Remove the backward compatible shims introduced to rename get_query_set and similar queryset методs. This affects the following classes: BaseModelAdmin, ChangeList, BaseCommentNode, GenericForeignKey, Manager, SingleRelatedObjectDescriptor and ReverseSingleRelatedObjectDescriptor.

  • Remove the backward compatible shims introduced to rename the attributes ChangeList.root_query_set and ChangeList.query_set.

  • django.views.defaults.shortcut будет удален, as part of the goal of removing all django.contrib references from the core Django codebase. Instead use django.contrib.contenttypes.views.shortcut. django.conf.urls.shortcut will also be removed.

  • Support for the Python Imaging Library (PIL) module будет удален, as it no longer appears to be actively maintained & does not work on Python 3.

  • The following private APIs будет удален:

    • 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 будет удален in favor of django.forms.widgets.RadioChoiceInput.

  • The module django.test.simple and the class django.test.simple.DjangoTestSuiteRunner будет удален. Instead use django.test.runner.DiscoverRunner.

  • The module django.test._doctest будет удален. Instead use the doctest module from the Python standard library.

  • The CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting будет удален.

  • Usage of the hard-coded Hold down «Control», or «Command» on a Mac, to select more than one. string to override or append to user-provided help_text in forms for ManyToMany model fields will not be performed by Django anymore either at the model or forms layer.

  • The Model._meta.get_(add|change|delete)_permission методs будет удален.

  • The session key django_language больше не будет be read for backwards compatibility.

  • Geographic Sitemaps будет удален (django.contrib.gis.sitemaps.views.index and django.contrib.gis.sitemaps.views.sitemap).

  • django.utils.html.fix_ampersands, the fix_ampersands template filter and django.utils.html.clean_html будет удален following an accelerated deprecation.

1.7

См. Django 1.5 примечания к выпуску для получения более подробной информации об этих изменениях.

  • The module django.utils.simplejson будет удален. The standard library provides json which should be used instead.

  • The функция django.utils.itercompat.product будет удален. The Python builtin version should be used instead.

  • Auto-correction of INSTALLED_APPS and TEMPLATE_DIRS settings when they are specified as a plain string instead of a tuple будет удален and raise an exception.

  • The mimetype argument to the __init__ методs of HttpResponse, SimpleTemplateResponse, and TemplateResponse, будет удален. content_type should be used instead. This also applies to the render_to_response() shortcut and the sitemap views, index() and sitemap().

  • When HttpResponse is instantiated with an iterator, or when content is set to an iterator, that iterator will be immediately consumed.

  • The AUTH_PROFILE_MODULE setting, and the get_profile() метод on the User model, будет удален.

  • The cleanup management command будет удален. It’s replaced by clearsessions.

  • The daily_cleanup.py script будет удален.

  • The depth keyword argument будет удален from select_related().

  • The undocumented get_warnings_state()/restore_warnings_state() функцияs from django.test.utils and the save_warnings_state()/ restore_warnings_state() django.test.*TestCase методs are deprecated. Use the warnings.catch_warnings context manager available starting with Python 2.6 instead.

  • The undocumented check_for_test_cookie метод in AuthenticationForm будет удален following an accelerated deprecation. Users subclassing this form should remove calls to this метод, and instead ensure that their auth related views are CSRF protected, which ensures that cookies are enabled.

  • The version of django.contrib.auth.views.password_reset_confirm() that supports base36 encoded user IDs (django.contrib.auth.views.password_reset_confirm_uidb36) will be removed. If your site has been running Django 1.6 for more than PASSWORD_RESET_TIMEOUT_DAYS, this change will have no effect. If not, then any password reset links generated before you upgrade to Django 1.7 won’t work after the upgrade.

  • The django.utils.encoding.StrAndUnicode mix-in будет удален.

1.6

См. Django 1.4 примечания к выпуску для получения более подробной информации об этих изменениях.

  • django.contrib.databrowse будет удален.

  • django.contrib.localflavor будет удален following an accelerated deprecation.

  • django.contrib.markup будет удален following an accelerated deprecation.

  • The compatibility modules django.utils.copycompat and django.utils.hashcompat as well as the функцияs django.utils.itercompat.all and django.utils.itercompat.any будет удален. The Python builtin versions should be used instead.

  • The csrf_response_exempt and csrf_view_exempt decorators будет удален. Since 1.4 csrf_response_exempt has been a no-op (it returns the same функция), and csrf_view_exempt has been a synonym for django.views.decorators.csrf.csrf_exempt, which should be used to replace it.

  • The django.core.cache.backends.memcached.CacheClass backend was split into two in Django 1.3 in order to introduce поддержка PyLibMC. The historical CacheClass будет удален in favor of django.core.cache.backends.memcached.MemcachedCache.

  • The UK-prefixed objects of django.contrib.localflavor.uk will only be accessible through their GB-prefixed names (GB is the correct ISO 3166 code for United Kingdom).

  • The IGNORABLE_404_STARTS and IGNORABLE_404_ENDS settings have been superseded by IGNORABLE_404_URLS in the 1.4 release. They будет удален.

  • The form wizard has been refactored to use class-based views with pluggable backends in 1.4. The previous implementation будет удален.

  • Legacy ways of calling cache_page() будет удален.

  • The backward-compatibility shim to automatically add a debug-false filter to the 'mail_admins' logging handler будет удален. The LOGGING setting should include this filter explicitly if it is desired.

  • The builtin truncation функцияs django.utils.text.truncate_words() and django.utils.text.truncate_html_words() будет удален in favor of the django.utils.text.Truncator class.

  • The django.contrib.gis.geoip.GeoIP class was moved to django.contrib.gis.geoip in 1.4 – the shortcut in django.contrib.gis.utils будет удален.

  • django.conf.urls.defaults будет удален. The функцияs include(), patterns(), and url(), plus handler404 and handler500 are now available through django.conf.urls.

  • The функцияs setup_environ() and execute_manager() будет удален from django.core.management. This also means that the old (pre-1.4) style of manage.py file больше не будет work.

  • Setting the is_safe and needs_autoescape flags as attributes of template filter функцияs больше не будет be supported.

  • The attribute HttpRequest.raw_post_data was renamed to HttpRequest.body in 1.4. The backward compatibility будет удален – HttpRequest.raw_post_data больше не будет work.

  • The value for the post_url_continue parameter in ModelAdmin.response_add() will have to be either None (to redirect to the newly created object’s edit page) or a pre-formatted url. String formats, such as the previous default '../%s/', will not be accepted any more.

1.5

См. Django 1.3 примечания к выпуску для получения более подробной информации об этих изменениях.

  • Starting Django without a SECRET_KEY will result in an exception rather than a DeprecationWarning. (This is accelerated from the usual deprecation path; see the Django 1.4 примечания к выпуску.)

  • The mod_python request handler будет удален. The mod_wsgi handler should be used instead.

  • The template attribute on django.test.client.Response objects returned by the test client будет удален. The templates attribute should be used instead.

  • The django.test.simple.DjangoTestRunner будет удален. Instead use a unittest-native class. The features of the django.test.simple.DjangoTestRunner (including fail-fast and Ctrl-C test termination) can be provided by unittest.TextTestRunner.

  • The undocumented функция django.contrib.formtools.utils.security_hash будет удален, instead use django.contrib.formtools.utils.form_hmac

  • The функция-based generic view modules будет удален in favor of their class-based equivalents, outlined here.

  • The django.core.servers.basehttp.AdminMediaHandler будет удален. In its place use django.contrib.staticfiles.handlers.StaticFilesHandler.

  • The template tags library adminmedia and the template tag {% admin_media_prefix %} будет удален in favor of the generic static files handling. (This is faster than the usual deprecation path; see the Django 1.4 release notes.)

  • The url and ssi template tags will be modified so that the first argument to each tag is a template variable, not an implied string. In 1.4, this behavior is provided by a version of the tag in the future template tag library.

  • The reset and sqlreset management commands будет удален.

  • Authentication backends will need to support an inactive user being passed to all методs dealing with permissions. The supports_inactive_user attribute больше не будет be checked and can be removed from custom backends.

  • transform() will raise a GEOSException when called on a geometry with no SRID value.

  • django.http.CompatCookie будет удален in favor of django.http.SimpleCookie.

  • django.core.context_processors.PermWrapper and django.core.context_processors.PermLookupDict будет удален in favor of the corresponding django.contrib.auth.context_processors.PermWrapper and django.contrib.auth.context_processors.PermLookupDict, respectively.

  • The MEDIA_URL or STATIC_URL settings будет обязательным to end with a trailing slash to ensure there is a consistent way to combine paths in templates.

  • django.db.models.fields.URLField.verify_exists будет удален. The feature was deprecated in 1.3.1 due to intractable security and performance issues and will follow a slightly accelerated deprecation timeframe.

  • Translations located under the so-called project path will be ignored during the translation building process performed at runtime. The LOCALE_PATHS setting can be used for the same task by including the filesystem path to a locale directory containing non-app-specific translations in its value.

  • The Markup contrib app больше не будет support versions of Python-Markdown library earlier than 2.1. An accelerated timeline was used as this was a security related deprecation.

  • The CACHE_BACKEND setting будет удален. The cache backend(s) should be specified in the CACHES setting.

1.4

См. Django 1.2 примечания к выпуску для получения более подробной информации об этих изменениях.

  • CsrfResponseMiddleware and CsrfMiddleware будет удален. Use the {% csrf_token %} template tag inside forms to enable CSRF protection. CsrfViewMiddleware remains and is enabled by default.

  • The old imports for CSRF функцияality (django.contrib.csrf.*), which moved to core in 1.2, будет удален.

  • The django.contrib.gis.db.backend module будет удален in favor of the specific backends.

  • SMTPConnection будет удален in favor of a generic email backend API.

  • The many to many SQL generation функцияs on the database backends будет удален.

  • The ability to use the DATABASE_* family of top-level settings to define database connections будет удален.

  • The ability to use shorthand notation to specify a database backend (i.e., sqlite3 instead of django.db.backends.sqlite3) будет удален.

  • The get_db_prep_save, get_db_prep_value and get_db_prep_lookup методs will have to support multiple databases.

  • The Message model (in django.contrib.auth), its related manager in the User model (user.message_set), and the associated методs (user.message_set.create() and user.get_and_delete_messages()), будет удален. The messages framework should be used instead. The related messages variable returned by the auth context processor will also be removed. Note that this means that the admin application will depend on the messages context processor.

  • Authentication backends will need to support the obj parameter for permission checking. The supports_object_permissions attribute больше не будет be checked and can be removed from custom backends.

  • Authentication backends will need to support the AnonymousUser class being passed to all методs dealing with permissions. The supports_anonymous_user variable больше не будет be checked and can be removed from custom backends.

  • The ability to specify a callable template loader rather than a Loader class будет удален, as will the load_template_source функцияs that are included with the built in template loaders for backwards compatibility.

  • django.utils.translation.get_date_formats() and django.utils.translation.get_partial_date_formats(). These функцияs будет удален; use the locale-aware django.utils.formats.get_format() to get the appropriate formats.

  • In django.forms.fields, the constants: DEFAULT_DATE_INPUT_FORMATS, DEFAULT_TIME_INPUT_FORMATS and DEFAULT_DATETIME_INPUT_FORMATS будет удален. Use django.utils.formats.get_format() to get the appropriate formats.

  • The ability to use a функция-based test runner будет удален, along with the django.test.simple.run_tests() test runner.

  • The views.feed() view and feeds.Feed class in django.contrib.syndication будет удален. The class-based view views.Feed should be used instead.

  • django.core.context_processors.auth. This release will remove the old метод in favor of the new метод in django.contrib.auth.context_processors.auth.

  • The postgresql database backend будет удален, use the postgresql_psycopg2 backend instead.

  • The no language code будет удален and has been replaced by the nb language code.

  • Authentication backends will need to define the boolean attribute supports_inactive_user until version 1.5 when it will be assumed that all backends will handle inactive users.

  • django.db.models.fields.XMLField будет удален. This was deprecated as part of the 1.3 release. An accelerated deprecation schedule has been used because the field hasn’t performed any role beyond that of a simple TextField since the removal of oldforms. All uses of XMLField can be replaced with TextField.

  • The undocumented mixin parameter to the open() метод of django.core.files.storage.Storage (and subclasses) будет удален.

1.3

См. Django 1.1 примечания к выпуску для получения более подробной информации об этих изменениях.

  • AdminSite.root(). This метод of hooking up the admin URLs будет удален in favor of including admin.site.urls.

  • Authentication backends need to define the boolean attributes supports_object_permissions and supports_anonymous_user until version 1.4, at which point it will be assumed that all backends will support these options.

Back to Top