1.8.txt 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. ============================================
  2. Django 1.8 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. Welcome to Django 1.8!
  5. These release notes cover the `new features`_, as well as some `backwards
  6. incompatible changes`_ you'll want to be aware of when upgrading from Django
  7. 1.6 or older versions. We've also `begun the deprecation process for some
  8. features`_, and some features have reached the end of their deprecation process
  9. and `have been removed`_.
  10. .. _`new features`: `What's new in Django 1.8`_
  11. .. _`backwards incompatible changes`: `Backwards incompatible changes in 1.8`_
  12. .. _`begun the deprecation process for some features`: `Features deprecated in 1.8`_
  13. .. _`have been removed`: `Features removed in 1.8`_
  14. Python compatibility
  15. ====================
  16. Like Django 1.7, Django 1.8 requires Python 2.7 or above, though we
  17. **highly recommend** the latest minor release.
  18. What's new in Django 1.8
  19. ========================
  20. Security enhancements
  21. ~~~~~~~~~~~~~~~~~~~~~
  22. Several features of the django-secure_ third-party library have been
  23. integrated into Django. :class:`django.middleware.security.SecurityMiddleware`
  24. provides several security enhancements to the request/response cycle. The new
  25. :djadminopt:`--deploy` option of the :djadmin:`check` command allows you to
  26. check your production settings file for ways to increase the security of your
  27. site.
  28. .. _django-secure: https://pypi.python.org/pypi/django-secure
  29. New PostgreSQL specific functionality
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. Django now has a module with extensions for PostgreSQL specific features, such
  32. as :class:`~django.contrib.postgres.fields.ArrayField` and
  33. :class:`~django.contrib.postgres.fields.HStoreField`. A full breakdown of the
  34. features is available :doc:`in the documentation</ref/contrib/postgres/index>`.
  35. New data types
  36. ~~~~~~~~~~~~~~
  37. * Django now has a :class:`~django.db.models.UUIDField` for storing
  38. universally unique identifiers. There is a corresponding :class:`form field
  39. <django.forms.UUIDField>`. It is stored as the native ``uuid`` data type on
  40. PostgreSQL and as a fixed length character field on other backends.
  41. Minor features
  42. ~~~~~~~~~~~~~~
  43. :mod:`django.contrib.admin`
  44. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  45. * :class:`~django.contrib.admin.ModelAdmin` now has a
  46. :meth:`~django.contrib.admin.ModelAdmin.has_module_permission`
  47. method to allow limiting access to the module on the admin index page.
  48. * :class:`~django.contrib.admin.InlineModelAdmin` now has an attribute
  49. :attr:`~django.contrib.admin.InlineModelAdmin.show_change_link` that
  50. supports showing a link to an inline object's change form.
  51. * Use the new ``django.contrib.admin.RelatedOnlyFieldListFilter`` in
  52. :attr:`ModelAdmin.list_filter <django.contrib.admin.ModelAdmin.list_filter>`
  53. to limit the ``list_filter`` choices to foreign objects which are attached to
  54. those from the ``ModelAdmin``.
  55. * The :meth:`ModelAdmin.delete_view()
  56. <django.contrib.admin.ModelAdmin.delete_view>` displays a summary of objects
  57. to be deleted on the deletion confirmation page.
  58. * The jQuery library embedded in the admin has been upgraded to version 1.11.1.
  59. * You can now specify :attr:`AdminSite.site_url
  60. <django.contrib.admin.AdminSite.site_url>` in order to display a link to the
  61. front-end site.
  62. * You can now specify :attr:`ModelAdmin.show_full_result_count
  63. <django.contrib.admin.ModelAdmin.show_full_result_count>` to control whether
  64. or not the full count of objects should be displayed on a filtered admin page.
  65. :mod:`django.contrib.admindocs`
  66. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  67. * reStructuredText is now parsed in model docstrings.
  68. :mod:`django.contrib.auth`
  69. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  70. * Authorization backends can now raise
  71. :class:`~django.core.exceptions.PermissionDenied` in
  72. :meth:`~django.contrib.auth.models.User.has_perm`
  73. and :meth:`~django.contrib.auth.models.User.has_module_perms`
  74. to short-circuit permission checking.
  75. * :class:`~django.contrib.auth.forms.PasswordResetForm` now
  76. has a method :meth:`~django.contrib.auth.forms.PasswordResetForm.send_email`
  77. that can be overridden to customize the mail to be sent.
  78. * The ``max_length`` of :attr:`Permission.name
  79. <django.contrib.auth.models.Permission.name>` has been increased from 50 to
  80. 255 characters. Please run the database migration.
  81. * :attr:`~django.contrib.auth.models.CustomUser.USERNAME_FIELD` and
  82. :attr:`~django.contrib.auth.models.CustomUser.REQUIRED_FIELDS` now supports
  83. :class:`~django.db.models.ForeignKey`\s.
  84. :mod:`django.contrib.formtools`
  85. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  86. * A :doc:`form wizard </ref/contrib/formtools/form-wizard>` using the
  87. :class:`~django.contrib.formtools.wizard.views.CookieWizardView` will now ignore
  88. an invalid cookie, and the wizard will restart from the first step. An invalid
  89. cookie can occur in cases of intentional manipulation, but also after a secret
  90. key change. Previously, this would raise ``WizardViewCookieModified``, a
  91. ``SuspiciousOperation``, causing an exception for any user with an invalid cookie
  92. upon every request to the wizard, until the cookie is removed.
  93. :mod:`django.contrib.gis`
  94. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  95. * Compatibility shims for ``SpatialRefSys`` and ``GeometryColumns`` changed in
  96. Django 1.2 have been removed.
  97. * The Spatialite backend now supports ``Collect`` and ``Extent`` aggregates
  98. when the database version is 3.0 or later.
  99. :mod:`django.contrib.messages`
  100. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  101. * ...
  102. :mod:`django.contrib.redirects`
  103. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  104. * ...
  105. :mod:`django.contrib.sessions`
  106. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  107. * Session cookie is now deleted after
  108. :meth:`~django.contrib.sessions.backends.base.SessionBase.flush()` is called.
  109. :mod:`django.contrib.sitemaps`
  110. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  111. * The new :attr:`Sitemap.i18n <django.contrib.sitemaps.Sitemap.i18n>` attribute
  112. allows you to generate a sitemap based on the :setting:`LANGUAGES` setting.
  113. :mod:`django.contrib.sites`
  114. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  115. * :func:`~django.contrib.sites.shortcuts.get_current_site` will now lookup
  116. the current site based on :meth:`request.get_host()
  117. <django.http.HttpRequest.get_host>` if the :setting:`SITE_ID` setting is not
  118. defined.
  119. :mod:`django.contrib.staticfiles`
  120. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  121. * ...
  122. :mod:`django.contrib.syndication`
  123. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  124. * ...
  125. Cache
  126. ^^^^^
  127. * The ``incr()`` method of the
  128. ``django.core.cache.backends.locmem.LocMemCache`` backend is now thread-safe.
  129. Database backends
  130. ^^^^^^^^^^^^^^^^^
  131. * The MySQL backend no longer strips microseconds from ``datetime`` values as
  132. MySQL 5.6.4 and up supports fractional seconds depending on the declaration
  133. of the datetime field (when ``DATETIME`` includes fractional precision greater
  134. than 0). New datetime database columns created with Django 1.8 and MySQL 5.6.4
  135. and up will support microseconds. See the :ref:`MySQL database notes
  136. <mysql-fractional-seconds>` for more details.
  137. Email
  138. ^^^^^
  139. * :ref:`Email backends <topic-email-backends>` now support the context manager
  140. protocol for opening and closing connections.
  141. * The SMTP email backend now supports ``keyfile`` and ``certfile``
  142. authentication with the :setting:`EMAIL_SSL_CERTFILE` and
  143. :setting:`EMAIL_SSL_KEYFILE` settings.
  144. * The SMTP :class:`~django.core.mail.backends.smtp.EmailBackend` now supports
  145. setting the ``timeout`` parameter with the :setting:`EMAIL_TIMEOUT` setting.
  146. File Storage
  147. ^^^^^^^^^^^^
  148. * ...
  149. File Uploads
  150. ^^^^^^^^^^^^
  151. * ...
  152. Forms
  153. ^^^^^
  154. * Form widgets now render attributes with a value of ``True`` or ``False``
  155. as HTML5 boolean attributes.
  156. * The new :meth:`~django.forms.Form.has_error()` method allows checking
  157. if a specific error has happened.
  158. * If :attr:`~django.forms.Form.required_css_class` is defined on a form, then
  159. the ``<label>`` tags for required fields will have this class present in its
  160. attributes.
  161. * The rendering of non-field errors in unordered lists (``<ul>``) now includes
  162. ``nonfield`` in its list of classes to distinguish them from field-specific
  163. errors.
  164. * :class:`~django.forms.Field` now accepts a
  165. :attr:`~django.forms.Field.label_suffix` argument, which will override the
  166. form's :attr:`~django.forms.Form.label_suffix`. This enables customizing the
  167. suffix on a per-field basis — previously it wasn't possible to override
  168. a form's :attr:`~django.forms.Form.label_suffix` while using shortcuts such
  169. as ``{{ form.as_p }}`` in templates.
  170. * :class:`~django.forms.extras.widgets.SelectDateWidget` now accepts an
  171. :attr:`~django.forms.extras.widgets.SelectDateWidget.empty_label` argument, which will
  172. override the top list choice label when :class:`~django.forms.DateField` is not required.
  173. * After an :class:`~django.forms.ImageField` has been cleaned and validated, the
  174. ``UploadedFile`` object will have an additional ``image`` attribute containing
  175. the Pillow ``Image`` instance used to check if the file was a valid image. It
  176. will also update ``UploadedFile.content_type`` with the image's content type
  177. as determined by Pillow.
  178. * You can now pass a callable that returns an iterable of choices when
  179. instantiating a :class:`~django.forms.ChoiceField`.
  180. Generic Views
  181. ^^^^^^^^^^^^^
  182. * Generic views that use :class:`~django.views.generic.list.MultipleObjectMixin`
  183. may now specify the ordering applied to the
  184. :attr:`~django.views.generic.list.MultipleObjectMixin.queryset` by setting
  185. :attr:`~django.views.generic.list.MultipleObjectMixin.ordering` or overriding
  186. :meth:`~django.views.generic.list.MultipleObjectMixin.get_ordering()`.
  187. * The new :attr:`SingleObjectMixin.query_pk_and_slug
  188. <django.views.generic.detail.SingleObjectMixin.query_pk_and_slug>`
  189. attribute allows changing the behavior of
  190. :meth:`~django.views.generic.detail.SingleObjectMixin.get_object()`
  191. so that it'll perform its lookup using both the primary key and the slug.
  192. * The :meth:`~django.views.generic.edit.FormMixin.get_form()` method doesn't
  193. require a ``form_class`` to be provided anymore. If not provided ``form_class``
  194. defaults to :meth:`~django.views.generic.edit.FormMixin.get_form_class()`.
  195. Internationalization
  196. ^^^^^^^^^^^^^^^^^^^^
  197. * :setting:`FORMAT_MODULE_PATH` can now be a list of strings representing
  198. module paths. This allows importing several format modules from different
  199. reusable apps. It also allows overriding those custom formats in your main
  200. Django project.
  201. Logging
  202. ^^^^^^^
  203. * The :class:`django.utils.log.AdminEmailHandler` class now has a
  204. :meth:`~django.utils.log.AdminEmailHandler.send_mail` method to make it more
  205. subclass friendly.
  206. Management Commands
  207. ^^^^^^^^^^^^^^^^^^^
  208. * :djadmin:`dumpdata` now has the option :djadminopt:`--output` which allows
  209. specifying the file to which the serialized data is written.
  210. * :djadmin:`makemessages` and :djadmin:`compilemessages` now have the option
  211. :djadminopt:`--exclude` which allows exclusion of specific locales from
  212. processing.
  213. * The :djadminopt:`--ignorenonexistent` option of the :djadmin:`loaddata`
  214. management command now ignores data for models that no longer exist.
  215. * :djadmin:`runserver` now uses daemon threads for faster reloading.
  216. * :djadmin:`inspectdb` now outputs ``Meta.unique_together``.
  217. * When calling management commands from code through :ref:`call_command
  218. <call-command>` and passing options, the option name can match the command
  219. line option name (without the initial dashes) or the final option destination
  220. variable name, but in either case, the resulting option received by the
  221. command is now always the ``dest`` name specified in the command option
  222. definition (as long as the command uses the new :py:mod:`argparse` module).
  223. * The :djadmin:`dbshell` command now supports MySQL's optional SSL certificate
  224. authority setting (``--ssl-ca``).
  225. * The :djadminopt:`--name` option for :djadmin:`makemigrations` allows you to
  226. to give the migration(s) a custom name instead of a generated one.
  227. * The :djadmin:`loaddata` command now prevents repeated fixture loading. If
  228. :setting:`FIXTURE_DIRS` contains duplicates or a default fixture directory
  229. path (``app_name/fixtures``), an exception is raised.
  230. Middleware
  231. ^^^^^^^^^^
  232. * The :attr:`CommonMiddleware.response_redirect_class
  233. <django.middleware.common.CommonMiddleware.response_redirect_class>`
  234. attribute allows you to customize the redirects issued by the middleware.
  235. Migrations
  236. ^^^^^^^^^^
  237. * The :class:`~django.db.migrations.operations.RunSQL` operation can now handle
  238. parameters passed to the SQL statements.
  239. * It is now possible to have migrations (most probably :ref:`data migrations
  240. <data-migrations>`) for applications without models.
  241. Models
  242. ^^^^^^
  243. * Django now logs at most 9000 queries in ``connections.queries``, in order
  244. to prevent excessive memory usage in long-running processes in debug mode.
  245. * There is now a model ``Meta`` option to define a
  246. :attr:`default related name <django.db.models.Options.default_related_name>`
  247. for all relational fields of a model.
  248. * Pickling models and querysets across different versions of Django isn't
  249. officially supported (it may work, but there's no guarantee). An extra
  250. variable that specifies the current Django version is now added to the
  251. pickled state of models and querysets, and Django raises a ``RuntimeWarning``
  252. when these objects are unpickled in a different version than the one in
  253. which they were pickled.
  254. * Added :meth:`Model.from_db() <django.db.models.Model.from_db()>` which
  255. Django uses whenever objects are loaded using the ORM. The method allows
  256. customizing model loading behavior.
  257. * ``extra(select={...})`` now allows you to escape a literal ``%s`` sequence
  258. using ``%%s``.
  259. * :doc:`Custom Lookups</howto/custom-lookups>` can now be registered using
  260. a decorator pattern.
  261. * The new :attr:`Transform.bilateral <django.db.models.Transform.bilateral>`
  262. attribute allows creating bilateral transformations. These transformations
  263. are applied to both ``lhs`` and ``rhs`` when used in a lookup expression,
  264. providing opportunities for more sophisticated lookups.
  265. Signals
  266. ^^^^^^^
  267. * Exceptions from the ``(receiver, exception)`` tuples returned by
  268. :meth:`Signal.send_robust() <django.dispatch.Signal.send_robust>` now have
  269. their traceback attached as a ``__traceback__`` attribute.
  270. * The ``environ`` argument, which contains the WSGI environment structure from
  271. the request, was added to the :data:`~django.core.signals.request_started`
  272. signal.
  273. System Check Framework
  274. ^^^^^^^^^^^^^^^^^^^^^^
  275. * :attr:`~django.core.checks.register` can now be used as a function.
  276. Templates
  277. ^^^^^^^^^
  278. * :tfilter:`urlize` now supports domain-only links that include characters after
  279. the top-level domain (e.g. ``djangoproject.com/`` and
  280. ``djangoproject.com/download/``).
  281. * :tfilter:`urlize` doesn't treat exclamation marks at the end of a domain or
  282. its query string as part of the URL (the URL in e.g. ``'djangoproject.com!``
  283. is ``djangoproject.com``)
  284. Requests and Responses
  285. ^^^^^^^^^^^^^^^^^^^^^^
  286. * ``WSGIRequest`` now respects paths starting with ``//``.
  287. * The :meth:`HttpRequest.build_absolute_uri()
  288. <django.http.HttpRequest.build_absolute_uri>` method now handles paths
  289. starting with ``//`` correctly.
  290. * If :setting:`DEBUG` is ``True`` and a request raises a
  291. :exc:`~django.core.exceptions.SuspiciousOperation`, the response will be
  292. rendered with a detailed error page.
  293. * The ``query_string`` argument of :class:`~django.http.QueryDict` is now
  294. optional, defaulting to ``None``, so a blank ``QueryDict`` can now be
  295. instantiated with ``QueryDict()`` instead of ``QueryDict(None)`` or
  296. ``QueryDict('')``.
  297. * The ``GET`` and ``POST`` attributes of an :class:`~django.http.HttpRequest`
  298. object are now :class:`~django.http.QueryDict`\s rather than dictionaries,
  299. and the ``FILES`` attribute is now a ``MultiValueDict``.
  300. This brings this class into line with the documentation and with
  301. ``WSGIRequest``.
  302. * The :attr:`HttpResponse.charset <django.http.HttpResponse.charset>` attribute
  303. was added.
  304. * ``WSGIRequestHandler`` now follows RFC in converting URI to IRI, using
  305. ``uri_to_iri()``.
  306. * The :meth:`HttpRequest.get_full_path()
  307. <django.http.HttpRequest.get_full_path>` method now escapes unsafe characters
  308. from the path portion of a Uniform Resource Identifier (URI) properly.
  309. * :class:`~django.http.HttpResponse` now implements a few additional methods
  310. like :meth:`~django.http.HttpResponse.getvalue` so that instances can be used
  311. as stream objects.
  312. Tests
  313. ^^^^^
  314. * The :class:`RequestFactory.trace() <django.test.RequestFactory>`
  315. and :class:`Client.trace() <django.test.Client.trace>` methods were
  316. implemented, allowing you to create ``TRACE`` requests in your tests.
  317. * The ``count`` argument was added to
  318. :meth:`~django.test.SimpleTestCase.assertTemplateUsed`. This allows you to
  319. assert that a template was rendered a specific number of times.
  320. * The new :meth:`~django.test.SimpleTestCase.assertJSONNotEqual` assertion
  321. allows you to test that two JSON fragments are not equal.
  322. * Added the ability to preserve the test database by adding the
  323. :djadminopt:`--keepdb` flag.
  324. * Added the :attr:`~django.test.Response.resolver_match` attribute to test
  325. client responses.
  326. * Added several settings that allow customization of test tablespace parameters
  327. for Oracle: :setting:`DATAFILE`, :setting:`DATAFILE_TMP`,
  328. :setting:`DATAFILE_MAXSIZE` and :setting:`DATAFILE_TMP_MAXSIZE`.
  329. Validators
  330. ^^^^^^^^^^
  331. * ...
  332. Backwards incompatible changes in 1.8
  333. =====================================
  334. .. warning::
  335. In addition to the changes outlined in this section, be sure to review the
  336. :ref:`deprecation plan <deprecation-removed-in-1.8>` for any features that
  337. have been removed. If you haven't updated your code within the
  338. deprecation timeline for a given feature, its removal may appear as a
  339. backwards incompatible change.
  340. Related object operations are run in a transaction
  341. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  342. Some operations on related objects such as
  343. :meth:`~django.db.models.fields.related.RelatedManager.add()` or
  344. :ref:`direct assignment<direct-assignment>` ran multiple data modifying
  345. queries without wrapping them in transactions. To reduce the risk of data
  346. corruption, all data modifying methods that affect multiple related objects
  347. (i.e. ``add()``, ``remove()``, ``clear()``, and :ref:`direct assignment
  348. <direct-assignment>`) now perform their data modifying queries from within a
  349. transaction, provided your database supports transactions.
  350. This has one backwards incompatible side effect, signal handlers triggered from
  351. these methods are now executed within the method's transaction and any
  352. exception in a signal handler will prevent the whole operation.
  353. Assigning unsaved objects to relations raises an error
  354. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  355. Assigning unsaved objects to a :class:`~django.db.models.ForeignKey`,
  356. :class:`~django.contrib.contenttypes.fields.GenericForeignKey`, and
  357. :class:`~django.db.models.OneToOneField` now raises a :exc:`ValueError`.
  358. Previously, the assignment of an unsaved object would be silently ignored.
  359. For example::
  360. >>> book = Book.objects.create(name="Django")
  361. >>> book.author = Author(name="John")
  362. >>> book.author.save()
  363. >>> book.save()
  364. >>> Book.objects.get(name="Django")
  365. >>> book.author
  366. >>>
  367. Now, an error will be raised to prevent data loss::
  368. >>> book.author = Author(name="john")
  369. Traceback (most recent call last):
  370. ...
  371. ValueError: Cannot assign "<Author: John>": "Author" instance isn't saved in the database.
  372. Management commands that only accept positional arguments
  373. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  374. If you have written a custom management command that only accepts positional
  375. arguments and you didn't specify the
  376. :attr:`~django.core.management.BaseCommand.args` command variable, you might
  377. get an error like ``Error: unrecognized arguments: ...``, as variable parsing
  378. is now based on :py:mod:`argparse` which doesn't implicitly accept positional
  379. arguments. You can make your command backwards compatible by simply setting the
  380. :attr:`~django.core.management.BaseCommand.args` class variable. However, if
  381. you don't have to keep compatibility with older Django versions, it's better to
  382. implement the new :meth:`~django.core.management.BaseCommand.add_arguments`
  383. method as described in :doc:`/howto/custom-management-commands`.
  384. Custom test management command arguments through test runner
  385. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  386. The method to add custom arguments to the `test` management command through the
  387. test runner has changed. Previously, you could provide an `option_list` class
  388. variable on the test runner to add more arguments (à la :py:mod:`optparse`).
  389. Now to implement the same behavior, you have to create an
  390. ``add_arguments(cls, parser)`` class method on the test runner and call
  391. ``parser.add_argument`` to add any custom arguments, as parser is now an
  392. :py:class:`argparse.ArgumentParser` instance.
  393. Model check ensures auto-generated column names are within limits specified by database
  394. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  395. A field name that's longer than the column name length supported by a database
  396. can create problems. For example, with MySQL you'll get an exception trying to
  397. create the column, and with PostgreSQL the column name is truncated by the
  398. database (you may see a warning in the PostgreSQL logs).
  399. A model check has been introduced to better alert users to this scenario before
  400. the actual creation of database tables.
  401. If you have an existing model where this check seems to be a false positive,
  402. for example on PostgreSQL where the name was already being truncated, simply
  403. use :attr:`~django.db.models.Field.db_column` to specify the name that's being
  404. used.
  405. The check also applies to the columns generated in an implicit
  406. ``ManyToManyField.through`` model. If you run into an issue there, use
  407. :attr:`~django.db.models.ManyToManyField.through` to create an explicit model
  408. and then specify :attr:`~django.db.models.Field.db_column` on its column(s)
  409. as needed.
  410. Query relation lookups now check object types
  411. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  412. Querying for model lookups now checks if the object passed is of correct type
  413. and raises a :exc:`ValueError` if not. Previously, Django didn't care if the
  414. object was of correct type; it just used the object's related field attribute
  415. (e.g. ``id``) for the lookup. Now, an error is raised to prevent incorrect
  416. lookups::
  417. >>> book = Book.objects.create(name="Django")
  418. >>> book = Book.objects.filter(author=book)
  419. Traceback (most recent call last):
  420. ...
  421. ValueError: Cannot query "<Book: Django>": Must be "Author" instance.
  422. Default ``EmailField.max_length`` increased to 254
  423. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  424. The old default 75 character ``max_length`` was not capable of storing all
  425. possible RFC3696/5321-compliant email addresses. In order to store all
  426. possible valid email addresses, the ``max_length`` has been increased to 254
  427. characters. You will need to generate and apply database migrations for your
  428. affected models (or add ``max_length=75`` if you wish to keep the length on
  429. your current fields). A migration for
  430. :attr:`django.contrib.auth.models.User.email` is included.
  431. Support for PostgreSQL versions older than 9.0
  432. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  433. The end of upstream support periods was reached in July 2014 for PostgreSQL 8.4.
  434. As a consequence, Django 1.8 sets 9.0 as the minimum PostgreSQL version it
  435. officially supports.
  436. This also includes dropping support for PostGIS 1.3 and 1.4 as these versions
  437. are not supported on versions of PostgreSQL later than 8.4.
  438. Django also now requires the use of Psycopg2 version 2.0.9 or higher.
  439. Support for MySQL versions older than 5.5
  440. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  441. The end of upstream support periods was reached in January 2012 for MySQL 5.0
  442. and December 2013 for MySQL 5.1. As a consequence, Django 1.8 sets 5.5 as the
  443. minimum MySQL version it officially supports.
  444. Support for Oracle versions older than 11.1
  445. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  446. The end of upstream support periods was reached in July 2010 for Oracle 9.2,
  447. January 2012 for Oracle 10.1, and July 2013 for Oracle 10.2. As a consequence,
  448. Django 1.8 sets 11.1 as the minimum Oracle version it officially supports.
  449. Specific privileges used instead of roles for tests on Oracle
  450. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  451. Earlier versions of Django granted the CONNECT and RESOURCE roles to the test
  452. user on Oracle. These roles have been deprecated, so Django 1.8 uses the
  453. specific underlying privileges instead. This changes the privileges required
  454. of the main user for running tests (unless the project is configured to avoid
  455. creating a test user). The exact privileges required now are detailed in
  456. :ref:`Oracle notes <oracle-notes>`.
  457. ``AbstractUser.last_login`` allows null values
  458. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  459. The :attr:`AbstractUser.last_login <django.contrib.auth.models.User.last_login>`
  460. field now allows null values. Previously, it defaulted to the time when the user
  461. was created which was misleading if the user never logged in. Please run the
  462. database migration. If your custom user inherits from ``AbstractUser`` and you
  463. wish to set ``last_login`` to ``NULL`` for users who haven't logged in, you can
  464. run this query::
  465. from django.db import models
  466. from django.contrib.auth import get_user_model
  467. from django.contrib.auth.models import AbstractBaseUser
  468. UserModel = get_user_model()
  469. if issubclass(UserModel, AbstractBaseUser):
  470. UserModel._default_manager.filter(
  471. last_login=models.F('date_joined')
  472. ).update(last_login=None)
  473. :mod:`django.contrib.gis`
  474. ~~~~~~~~~~~~~~~~~~~~~~~~~
  475. * Support for GEOS 3.1 and GDAL 1.6 has been dropped.
  476. * Support for SpatiaLite < 2.4 has been dropped.
  477. * GIS-specific lookups have been refactored to use the
  478. :class:`django.db.models.Lookup` API.
  479. * The default ``str`` representation of
  480. :class:`~django.contrib.gis.geos.GEOSGeometry` objects has been changed from
  481. WKT to EWKT format (including the SRID). As this representation is used in
  482. the serialization framework, that means that ``dumpdata`` output will now
  483. contain the SRID value of geometry objects.
  484. Priority of context processors for ``TemplateResponse`` brought in line with ``render``
  485. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486. The :class:`~django.template.response.TemplateResponse` constructor is designed to be a
  487. drop-in replacement for the :func:`~django.shortcuts.render` function. However,
  488. it had a slight incompatibility, in that for ``TemplateResponse``, context data
  489. from the passed in context dictionary could be shadowed by context data returned
  490. from context processors, whereas for ``render`` it was the other way
  491. around. This was a bug, and the behavior of ``render`` is more appropriate,
  492. since it allows the globally defined context processors to be overridden locally
  493. in the view. If you were relying on the fact context data in a
  494. ``TemplateResponse`` could be overridden using a context processor, you will
  495. need to change your code.
  496. Miscellaneous
  497. ~~~~~~~~~~~~~
  498. * ``connections.queries`` is now a read-only attribute.
  499. * Database connections are considered equal only if they're the same object.
  500. They aren't hashable any more.
  501. * :class:`~django.middleware.gzip.GZipMiddleware` used to disable compression
  502. for some content types when the request is from Internet Explorer, in order
  503. to work around a bug in IE6 and earlier. This behavior could affect
  504. performance on IE7 and later. It was removed.
  505. * ``URLField.to_python`` no longer adds a trailing slash to pathless URLs.
  506. * The :tfilter:`length` template filter now returns ``0`` for an undefined
  507. variable, rather than an empty string.
  508. * ``ForeignKey.default_error_message['invalid']`` has been changed from
  509. ``'%(model)s instance with pk %(pk)r does not exist.'`` to
  510. ``'%(model)s instance with %(field)s %(value)r does not exist.'`` If you are
  511. using this message in your own code, please update the list of interpolated
  512. parameters. Internally, Django will continue to provide the
  513. ``pk`` parameter in ``params`` for backwards compatibility.
  514. * ``UserCreationForm.errors_messages['duplicate_username']`` is no longer used.
  515. If you wish to customize that error message, :ref:`override it on the form
  516. <modelforms-overriding-default-fields>` using the ``'unique'`` key in
  517. ``Meta.errors_messages['username']`` or, if you have a custom form field for
  518. ``'username'``, using the the ``'unique'`` key in its
  519. :attr:`~django.forms.Field.error_messages` argument.
  520. * ``AdminSite`` no longer takes an ``app_name`` argument and its ``app_name``
  521. attribute has been removed. The application name is always ``admin`` (as
  522. opposed to the instance name which you can still customize using
  523. ``AdminSite(name="...")``.
  524. * Internal changes were made to the :class:`~django.forms.ClearableFileInput`
  525. widget to allow more customization. The undocumented ``url_markup_template``
  526. attribute was removed in favor of ``template_with_initial``.
  527. * For consistency with other major vendors, the ``en_GB`` locale now has Monday
  528. as the first day of the week.
  529. * Seconds have been removed from any locales that had them in ``TIME_FORMAT``,
  530. ``DATETIME_FORMAT``, or ``SHORT_DATETIME_FORMAT``.
  531. * The default max size of the Oracle test tablespace has increased from 200M
  532. to 500M.
  533. * :func:`~django.core.urlresolvers.reverse` and
  534. :func:`~django.core.urlresolvers.reverse_lazy` now return Unicode strings
  535. instead of byte strings.
  536. * The ``CacheClass`` shim has been removed from all cache backends.
  537. These aliases were provided for backwards compatibility with Django 1.3.
  538. If you are still using them, please update your project to use the real
  539. class name found in the :setting:`BACKEND <CACHES-BACKEND>` key of the
  540. :setting:`CACHES` setting.
  541. * By default, :ref:`call_command <call-command>` now always skips the check
  542. framework (unless you pass it ``skip_checks=False``).
  543. * When iterating over lines, :class:`~django.core.files.File` now uses
  544. `universal newlines`_. The following are recognized as ending a line: the
  545. Unix end-of-line convention ``'\n'``, the Windows convention ``'\r\n'``, and
  546. the old Macintosh convention ``'\r'``.
  547. .. _universal newlines: http://www.python.org/dev/peps/pep-0278
  548. * The Memcached cache backends ``MemcachedCache`` and ``PyLibMCCache`` will
  549. delete a key if ``set()`` fails. This is necessary to ensure the ``cache_db``
  550. session store always fetches the most current session data.
  551. .. _deprecated-features-1.8:
  552. Features deprecated in 1.8
  553. ==========================
  554. Loading ``cycle`` and ``firstof`` template tags from ``future`` library
  555. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  556. Django 1.6 introduced ``{% load cycle from future %}`` and
  557. ``{% load firstof from future %}`` syntax for forward compatibility of the
  558. :ttag:`cycle` and :ttag:`firstof` template tags. This syntax is now deprecated
  559. and will be removed in Django 2.0. You can simply remove the
  560. ``{% load ... from future %}`` tags.
  561. ``django.conf.urls.patterns()``
  562. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  563. In the olden days of Django, it was encouraged to reference views as strings
  564. in ``urlpatterns``::
  565. urlpatterns = patterns('',
  566. url('^$', 'myapp.views.myview'),
  567. )
  568. and Django would magically import ``myapp.views.myview`` internally and turn
  569. the string into a real function reference. In order to reduce repetition when
  570. referencing many views from the same module, the ``patterns()`` function takes
  571. a required initial ``prefix`` argument which is prepended to all
  572. views-as-strings in that set of ``urlpatterns``::
  573. urlpatterns = patterns('myapp.views',
  574. url('^$', 'myview'),
  575. url('^other/$', 'otherview'),
  576. )
  577. In the modern era, we have updated the tutorial to instead recommend importing
  578. your views module and referencing your view functions (or classes) directly.
  579. This has a number of advantages, all deriving from the fact that we are using
  580. normal Python in place of "Django String Magic": the errors when you mistype a
  581. view name are less obscure, IDEs can help with autocompletion of view names,
  582. etc.
  583. So these days, the above use of the ``prefix`` arg is much more likely to be
  584. written (and is better written) as::
  585. from myapp import views
  586. urlpatterns = patterns('',
  587. url('^$', views.myview),
  588. url('^other/$', views.otherview),
  589. )
  590. Thus ``patterns()`` serves little purpose and is a burden when teaching new users
  591. (answering the newbie's question "why do I need this empty string as the first
  592. argument to ``patterns()``?"). For these reasons, we are deprecating it.
  593. Updating your code is as simple as ensuring that ``urlpatterns`` is a list of
  594. :func:`django.conf.urls.url` instances. For example::
  595. from django.conf.urls import url
  596. from myapp import views
  597. urlpatterns = [
  598. url('^$', views.myview),
  599. url('^other/$', views.otherview),
  600. ]
  601. Passing a string as ``view`` to :func:`~django.conf.urls.url`
  602. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  603. Related to the previous item, referencing views as strings in the ``url()``
  604. function is deprecated. Pass the callable view as described in the previous
  605. section instead.
  606. ``django.test.SimpleTestCase.urls``
  607. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  608. The attribute :attr:`SimpleTestCase.urls <django.test.SimpleTestCase.urls>`
  609. for specifying URLconf configuration in tests has been deprecated and will be
  610. removed in Django 2.0. Use :func:`@override_settings(ROOT_URLCONF=...)
  611. <django.test.override_settings>` instead.
  612. ``prefix`` argument to :func:`~django.conf.urls.i18n.i18n_patterns`
  613. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  614. Related to the previous item, the ``prefix`` argument to
  615. :func:`django.conf.urls.i18n.i18n_patterns` has been deprecated. Simply pass a
  616. list of :func:`django.conf.urls.url` instances instead.
  617. Using an incorrect count of unpacked values in the :ttag:`for` template tag
  618. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619. Using an incorrect count of unpacked values in :ttag:`for` tag will raise an
  620. exception rather than fail silently in Django 2.0.
  621. Passing a dotted path to :func:`~django.core.urlresolvers.reverse()` and :ttag:`url`
  622. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  623. Reversing URLs by Python path is an expensive operation as it causes the
  624. path being reversed to be imported. This behavior has also resulted in a
  625. `security issue`_. Use :ref:`named URL patterns <naming-url-patterns>`
  626. for reversing instead.
  627. If you are using :mod:`django.contrib.sitemaps`, add the ``name`` argument to
  628. the ``url`` that references :func:`django.contrib.sitemaps.views.sitemap`::
  629. from django.contrib.sitemaps.views import sitemap
  630. url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
  631. name='django.contrib.sitemaps.views.sitemap')
  632. to ensure compatibility when reversing by Python path is removed in Django 2.0.
  633. Similarly for GIS sitemaps, add ``name='django.contrib.gis.sitemaps.views.kml'``
  634. or ``name='django.contrib.gis.sitemaps.views.kmz'``.
  635. .. _security issue: https://www.djangoproject.com/weblog/2014/apr/21/security/#s-issue-unexpected-code-execution-using-reverse
  636. Extending management command arguments through ``Command.option_list``
  637. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  638. Management commands now use :py:mod:`argparse` instead of :py:mod:`optparse` to
  639. parse command-line arguments passed to commands. This also means that the way
  640. to add custom arguments to commands has changed: instead of extending the
  641. ``option_list`` class list, you should now override the
  642. :meth:`~django.core.management.BaseCommand.add_arguments` method and add
  643. arguments through ``argparse.add_argument()``. See
  644. :ref:`this example <custom-commands-options>` for more details.
  645. ``django.core.management.NoArgsCommand``
  646. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  647. The class :class:`~django.core.management.NoArgsCommand` is now deprecated and
  648. will be removed in Django 2.0. Use :class:`~django.core.management.BaseCommand`
  649. instead, which takes no arguments by default.
  650. ``cache_choices`` option of ``ModelChoiceField`` and ``ModelMultipleChoiceField``
  651. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  652. :class:`~django.forms.ModelChoiceField` and
  653. :class:`~django.forms.ModelMultipleChoiceField` took an undocumented, untested
  654. option ``cache_choices``. This cached querysets between multiple renderings of
  655. the same ``Form`` object. This option is subject to an accelerated deprecation
  656. and will be removed in Django 1.9.
  657. ``django.template.resolve_variable()``
  658. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  659. The function has been informally marked as "Deprecated" for some time. Replace
  660. ``resolve_variable(path, context)`` with
  661. ``django.template.Variable(path).resolve(context)``.
  662. ``django.contrib.webdesign``
  663. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  664. It provided the :ttag:`lorem` template tag which is now included in the
  665. built-in tags. Simply remove ``'django.contrib.webdesign'`` from
  666. :setting:`INSTALLED_APPS` and ``{% load webdesign %}`` from your templates.
  667. ``error_message`` argument to ``django.forms.RegexField``
  668. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  669. It provided backwards compatibility for pre-1.0 code, but its functionality is
  670. redundant. Use ``Field.error_messages['invalid']`` instead.
  671. Old :tfilter:`unordered_list` syntax
  672. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  673. An older (pre-1.0), more restrictive and verbose input format for the
  674. :tfilter:`unordered_list` template filter has been deprecated::
  675. ``['States', [['Kansas', [['Lawrence', []], ['Topeka', []]]], ['Illinois', []]]]``
  676. Using the new syntax, this becomes::
  677. ``['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]``
  678. ``django.forms.Field._has_changed()``
  679. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  680. Rename this method to :meth:`~django.forms.Field.has_changed` by removing the
  681. leading underscore. The old name will still work until Django 2.0.
  682. ``django.utils.html.remove_tags()`` and ``removetags`` template filter
  683. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  684. ``django.utils.html.remove_tags()`` as well as the template filter
  685. ``removetags`` have been deprecated as they cannot guarantee safe output. Their
  686. existence is likely to lead to their use in security-sensitive contexts where
  687. they are not actually safe.
  688. The unused and undocumented ``django.utils.html.strip_entities()`` function has
  689. also been deprecated.
  690. ``is_admin_site`` argument to ``django.contrib.auth.views.password_reset()``
  691. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  692. It's a legacy option that should no longer be necessary.
  693. ``SubfieldBase``
  694. ~~~~~~~~~~~~~~~~
  695. ``django.db.models.fields.subclassing.SubfieldBase`` has been deprecated and
  696. will be removed in Django 2.0. Historically, it was used to handle fields where
  697. type conversion was needed when loading from the database, but it was not used
  698. in ``.values()`` calls or in aggregates. It has been replaced with
  699. :meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
  700. not call the :meth:`~django.db.models.Field.to_python` method on assignment
  701. as was the case with ``SubfieldBase``.
  702. ``django.utils.checksums``
  703. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  704. The ``django.utils.checksums`` module has been deprecated and will be removed
  705. in Django 2.0. The functionality it provided (validating checksum using the
  706. Luhn algorithm) was undocumented and not used in Django. The module has been
  707. moved to the `django-localflavor`_ package (version 1.1+).
  708. .. _django-localflavor: https://pypi.python.org/pypi/django-localflavor
  709. ``django.contrib.admin.helpers.InlineAdminForm.original_content_type_id``
  710. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711. The ``original_content_type_id`` attribute on ``InlineAdminForm`` has been
  712. deprecated and will be removed in Django 2.0. Historically, it was used
  713. to construct the "view on site" URL. This URL is now accessible using the
  714. ``absolute_url`` attribute of the form.
  715. ``django.views.generic.edit.FormMixin.get_form()``’s ``form_class`` argument
  716. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  717. ``FormMixin`` subclasses that override the ``get_form()`` method should make
  718. sure to provide a default value for the ``form_class`` argument since it's
  719. now optional.
  720. Overriding ``setUpClass`` / ``tearDownClass`` in test cases
  721. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  722. The decorators :func:`~django.test.override_settings` and
  723. :func:`~django.test.modify_settings` now act at the class level when used as
  724. class decorators. As a consequence, when overriding ``setUpClass()`` or
  725. ``tearDownClass()``, the ``super`` implementation should always be called.
  726. .. removed-features-1.8:
  727. Features removed in 1.8
  728. =======================
  729. These features have reached the end of their deprecation cycle and so have been
  730. removed in Django 1.8 (please see the :ref:`deprecation timeline
  731. <deprecation-removed-in-1.8>` for more details):
  732. * ``django.contrib.comments`` is removed.
  733. * The following transaction management APIs are removed:
  734. - ``TransactionMiddleware``
  735. - the decorators and context managers ``autocommit``, ``commit_on_success``,
  736. and ``commit_manually``, defined in ``django.db.transaction``
  737. - the functions ``commit_unless_managed`` and ``rollback_unless_managed``,
  738. also defined in ``django.db.transaction``
  739. - the ``TRANSACTIONS_MANAGED`` setting
  740. * The :ttag:`cycle` and :ttag:`firstof` template tags auto-escape their
  741. arguments.
  742. * The ``SEND_BROKEN_LINK_EMAILS`` setting is removed.
  743. * ``django.middleware.doc.XViewMiddleware`` is removed.
  744. * The ``Model._meta.module_name`` alias is removed.
  745. * The backward compatible shims introduced to rename ``get_query_set``
  746. and similar queryset methods are removed. This affects the following classes:
  747. ``BaseModelAdmin``, ``ChangeList``, ``BaseCommentNode``,
  748. ``GenericForeignKey``, ``Manager``, ``SingleRelatedObjectDescriptor`` and
  749. ``ReverseSingleRelatedObjectDescriptor``.
  750. * The backward compatible shims introduced to rename the attributes
  751. ``ChangeList.root_query_set`` and ``ChangeList.query_set`` are removed.
  752. * ``django.views.defaults.shortcut`` and ``django.conf.urls.shortcut`` are
  753. removed.
  754. * Support for the Python Imaging Library (PIL) module is removed.
  755. * The following private APIs are removed:
  756. - ``django.db.backend``
  757. - ``django.db.close_connection()``
  758. - ``django.db.backends.creation.BaseDatabaseCreation.set_autocommit()``
  759. - ``django.db.transaction.is_managed()``
  760. - ``django.db.transaction.managed()``
  761. * ``django.forms.widgets.RadioInput`` is removed.
  762. * The module ``django.test.simple`` and the class
  763. ``django.test.simple.DjangoTestSuiteRunner`` are removed.
  764. * The module ``django.test._doctest`` is removed.
  765. * The ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting is removed.
  766. * Usage of the hard-coded *Hold down "Control", or "Command" on a Mac, to select
  767. more than one.* string to override or append to user-provided ``help_text`` in
  768. forms for ``ManyToMany`` model fields is not be performed by Django anymore
  769. either at the model or forms layer.
  770. * The ``Model._meta.get_(add|change|delete)_permission`` methods are removed.
  771. * The session key ``django_language`` is no longer read for backwards
  772. compatibility.
  773. * Geographic Sitemaps are removed
  774. (``django.contrib.gis.sitemaps.views.index`` and
  775. ``django.contrib.gis.sitemaps.views.sitemap``).
  776. * ``django.utils.html.fix_ampersands``, the ``fix_ampersands`` template filter,
  777. and ``django.utils.html.clean_html`` are removed.