1.9.txt 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109
  1. ============================================
  2. Django 1.9 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. Welcome to Django 1.9!
  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.8 or older versions. We've :ref:`dropped some features
  8. <deprecation-removed-in-1.9>` that have reached the end of their deprecation
  9. cycle, and we've `begun the deprecation process for some features`_.
  10. .. _`new features`: `What's new in Django 1.9`_
  11. .. _`backwards incompatible changes`: `Backwards incompatible changes in 1.9`_
  12. .. _`dropped some features`: `Features removed in 1.9`_
  13. .. _`begun the deprecation process for some features`: `Features deprecated in 1.9`_
  14. Python compatibility
  15. ====================
  16. Like Django 1.8, Django 1.9 requires Python 2.7 or above, though we
  17. **highly recommend** the latest minor release. We've dropped support for
  18. Python 3.2 and 3.3, and added support for Python 3.5.
  19. What's new in Django 1.9
  20. ========================
  21. Performing actions after a transaction commit
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. The new :func:`~django.db.transaction.on_commit` hook allows performing actions
  24. after a database transaction is successfully committed. This is useful for
  25. tasks such as sending notification emails, creating queued tasks, or
  26. invalidating caches.
  27. This functionality from the `django-transaction-hooks`_ package has been
  28. integrated into Django.
  29. .. _django-transaction-hooks: https://pypi.python.org/pypi/django-transaction-hooks
  30. Password validation
  31. ~~~~~~~~~~~~~~~~~~~
  32. Django now offers password validation to help prevent the usage of weak
  33. passwords by users. The validation is integrated in the included password
  34. change and reset forms and is simple to integrate in any other code.
  35. Validation is performed by one or more validators, configured in the new
  36. :setting:`AUTH_PASSWORD_VALIDATORS` setting.
  37. Four validators are included in Django, which can enforce a minimum length,
  38. compare the password to the user's attributes like their name, ensure
  39. passwords aren't entirely numeric, or check against an included list of common
  40. passwords. You can combine multiple validators, and some validators have
  41. custom configuration options. For example, you can choose to provide a custom
  42. list of common passwords. Each validator provides a help text to explain its
  43. requirements to the user.
  44. By default, no validation is performed and all passwords are accepted, so if
  45. you don't set :setting:`AUTH_PASSWORD_VALIDATORS`, you will not see any
  46. change. In new projects created with the default :djadmin:`startproject`
  47. template, a simple set of validators is enabled. To enable basic validation in
  48. the included auth forms for your project, you could set, for example::
  49. AUTH_PASSWORD_VALIDATORS = [
  50. {
  51. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  52. },
  53. {
  54. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  55. },
  56. {
  57. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  58. },
  59. {
  60. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  61. },
  62. ]
  63. See :ref:`password-validation` for more details.
  64. Permission mixins for class-based views
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. Django now ships with the mixins
  67. :class:`~django.contrib.auth.mixins.AccessMixin`,
  68. :class:`~django.contrib.auth.mixins.LoginRequiredMixin`,
  69. :class:`~django.contrib.auth.mixins.PermissionRequiredMixin`, and
  70. :class:`~django.contrib.auth.mixins.UserPassesTestMixin` to provide the
  71. functionality of the ``django.contrib.auth.decorators`` for class-based views.
  72. These mixins have been taken from, or are at least inspired by, the
  73. `django-braces`_ project.
  74. There are a few differences between Django's and django-braces' implementation,
  75. though:
  76. * The :attr:`~django.contrib.auth.mixins.AccessMixin.raise_exception` attribute
  77. can only be ``True`` or ``False``. Custom exceptions or callables are not
  78. supported.
  79. * The :meth:`~django.contrib.auth.mixins.AccessMixin.handle_no_permission`
  80. method does not take a ``request`` argument. The current request is available
  81. in ``self.request``.
  82. * The custom ``test_func()`` of :class:`~django.contrib.auth.mixins.UserPassesTestMixin`
  83. does not take a ``user`` argument. The current user is available in
  84. ``self.request.user``.
  85. * The :attr:`permission_required <django.contrib.auth.mixins.PermissionRequiredMixin>`
  86. attribute supports a string (defining one permission) or a list/tuple of
  87. strings (defining multiple permissions) that need to be fulfilled to grant
  88. access.
  89. * The new :attr:`~django.contrib.auth.mixins.AccessMixin.permission_denied_message`
  90. attribute allows passing a message to the ``PermissionDenied`` exception.
  91. .. _django-braces: http://django-braces.readthedocs.org/en/latest/index.html
  92. Minor features
  93. ~~~~~~~~~~~~~~
  94. :mod:`django.contrib.admin`
  95. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  96. * Admin views now have ``model_admin`` or ``admin_site`` attributes.
  97. * The URL of the admin change view has been changed (was at
  98. ``/admin/<app>/<model>/<pk>/`` by default and is now at
  99. ``/admin/<app>/<model>/<pk>/change/``). This should not affect your
  100. application unless you have hardcoded admin URLs. In that case, replace those
  101. links by :ref:`reversing admin URLs <admin-reverse-urls>` instead. Note that
  102. the old URL still redirects to the new one for backwards compatibility, but
  103. it may be removed in a future version.
  104. * :meth:`ModelAdmin.get_list_select_related()
  105. <django.contrib.admin.ModelAdmin.get_list_select_related>` was added to allow
  106. changing the ``select_related()`` values used in the admin's changelist query
  107. based on the request.
  108. * The ``available_apps`` context variable, which lists the available
  109. applications for the current user, has been added to the
  110. :meth:`AdminSite.each_context() <django.contrib.admin.AdminSite.each_context>`
  111. method.
  112. * :attr:`AdminSite.empty_value_display
  113. <django.contrib.admin.AdminSite.empty_value_display>` and
  114. :attr:`ModelAdmin.empty_value_display
  115. <django.contrib.admin.ModelAdmin.empty_value_display>` were added to override
  116. the display of empty values in admin change list. You can also customize the
  117. value for each field.
  118. * The time picker widget includes a '6 p.m' option for consistency of having
  119. predefined options every 6 hours.
  120. * JavaScript slug generation now supports Romanian characters.
  121. :mod:`django.contrib.auth`
  122. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  123. * The default iteration count for the PBKDF2 password hasher has been increased
  124. by 20%. This backwards compatible change will not affect users who have
  125. subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
  126. default value.
  127. * The ``BCryptSHA256PasswordHasher`` will now update passwords if its
  128. ``rounds`` attribute is changed.
  129. * ``AbstractBaseUser`` and ``BaseUserManager`` were moved to a new
  130. ``django.contrib.auth.base_user`` module so that they can be imported without
  131. including ``django.contrib.auth`` in :setting:`INSTALLED_APPS` (this raised
  132. a deprecation warning in older versions and is no longer supported in
  133. Django 1.9).
  134. * The permission argument of
  135. :func:`~django.contrib.auth.decorators.permission_required()` accepts all
  136. kinds of iterables, not only list and tuples.
  137. * The new :class:`~django.contrib.auth.middleware.PersistentRemoteUserMiddleware`
  138. makes it possible to use ``REMOTE_USER`` for setups where the header is only
  139. populated on login pages instead of every request in the session.
  140. :mod:`django.contrib.gis`
  141. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  142. * All ``GeoQuerySet`` methods have been deprecated and replaced by
  143. :doc:`equivalent database functions </ref/contrib/gis/functions>`. As soon
  144. as the legacy methods have been replaced in your code, you should even be
  145. able to remove the special ``GeoManager`` from your GIS-enabled classes.
  146. * The GDAL interface now supports instantiating file-based and in-memory
  147. :ref:`GDALRaster objects <raster-data-source-objects>` from raw data.
  148. Setters for raster properties such as projection or pixel values have
  149. been added.
  150. * For PostGIS users, the new :class:`~django.contrib.gis.db.models.RasterField`
  151. allows :ref:`storing GDALRaster objects <creating-and-saving-raster-models>`.
  152. It supports automatic spatial index creation and reprojection when saving a
  153. model. It does not yet support spatial querying.
  154. * The new :meth:`GDALRaster.warp() <django.contrib.gis.gdal.GDALRaster.warp>`
  155. method allows warping a raster by specifying target raster properties such as
  156. origin, width, height, or pixel size (amongst others).
  157. * The new :meth:`GDALRaster.transform()
  158. <django.contrib.gis.gdal.GDALRaster.transform>` method allows transforming a
  159. raster into a different spatial reference system by specifying a target
  160. ``srid``.
  161. :mod:`django.contrib.messages`
  162. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  163. * ...
  164. :mod:`django.contrib.postgres`
  165. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  166. * Added support for the :lookup:`rangefield.contained_by` lookup for some built
  167. in fields which correspond to the range fields.
  168. * Added :class:`~django.contrib.postgres.fields.JSONField`.
  169. * Added :doc:`/ref/contrib/postgres/aggregates`.
  170. * Fixed serialization of
  171. :class:`~django.contrib.postgres.fields.DateRangeField` and
  172. :class:`~django.contrib.postgres.fields.DateTimeRangeField`.
  173. * Added the :class:`~django.contrib.postgres.functions.TransactionNow` database
  174. function.
  175. :mod:`django.contrib.redirects`
  176. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  177. * ...
  178. :mod:`django.contrib.sessions`
  179. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  180. * ...
  181. :mod:`django.contrib.sitemaps`
  182. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  183. * ...
  184. :mod:`django.contrib.sites`
  185. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  186. * :func:`~django.contrib.sites.shortcuts.get_current_site` now handles the case
  187. where ``request.get_host()`` returns ``domain:port``, e.g.
  188. ``example.com:80``. If the lookup fails because the host does not match a
  189. record in the database and the host has a port, the port is stripped and the
  190. lookup is retried with the domain part only.
  191. :mod:`django.contrib.staticfiles`
  192. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  193. * ...
  194. :mod:`django.contrib.syndication`
  195. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  196. * ...
  197. Cache
  198. ^^^^^
  199. * ``django.core.cache.backends.base.BaseCache`` now has a ``get_or_set()``
  200. method.
  201. * :func:`django.views.decorators.cache.never_cache` now sends more persuasive
  202. headers (added ``no-cache, no-store, must-revalidate`` to ``Cache-Control``)
  203. to better prevent caching.
  204. Email
  205. ^^^^^
  206. * ...
  207. File Storage
  208. ^^^^^^^^^^^^
  209. * :meth:`Storage.get_valid_name()
  210. <django.core.files.storage.Storage.get_valid_name>` is now called when
  211. the :attr:`~django.db.models.FileField.upload_to` is a callable.
  212. * :class:`~django.core.files.File` now has the ``seekable()`` method when using
  213. Python 3.
  214. File Uploads
  215. ^^^^^^^^^^^^
  216. * ...
  217. Forms
  218. ^^^^^
  219. * :class:`~django.forms.ModelForm` accepts the new ``Meta`` option
  220. ``field_classes`` to customize the type of the fields. See
  221. :ref:`modelforms-overriding-default-fields` for details.
  222. * You can now specify the order in which form fields are rendered with the
  223. :attr:`~django.forms.Form.field_order` attribute, the ``field_order``
  224. constructor argument , or the :meth:`~django.forms.Form.order_fields` method.
  225. * A form prefix can be specified inside a form class, not only when
  226. instantiating a form. See :ref:`form-prefix` for details.
  227. * You can now :ref:`specify keyword arguments <custom-formset-form-kwargs>`
  228. that you want to pass to the constructor of forms in a formset.
  229. * :class:`~django.forms.CharField` now accepts a
  230. :attr:`~django.forms.CharField.strip` argument to strip input data of leading
  231. and trailing whitespace. As this defaults to ``True`` this is different
  232. behavior from previous releases.
  233. Generic Views
  234. ^^^^^^^^^^^^^
  235. * Class based views generated using ``as_view()`` now have ``view_class``
  236. and ``view_initkwargs`` attributes.
  237. Internationalization
  238. ^^^^^^^^^^^^^^^^^^^^
  239. * The :func:`django.views.i18n.set_language` view now properly redirects to
  240. :ref:`translated URLs <url-internationalization>`, when available.
  241. * The :func:`django.views.i18n.javascript_catalog` view now works correctly
  242. if used multiple times with different configurations on the same page.
  243. * The :func:`django.utils.timezone.make_aware` function gained an ``is_dst``
  244. argument to help resolve ambiguous times during DST transitions.
  245. * You can now use locale variants supported by gettext. These are usually used
  246. for languages which can be written in different scripts, for example Latin
  247. and Cyrillic (e.g. ``be@latin``).
  248. * Added the ``name_translated`` attribute to the object returned by the
  249. :ttag:`get_language_info` template tag. Also added a corresponding template
  250. filter: :tfilter:`language_name_translated`.
  251. * You can now run :djadmin:`compilemessages` from the root directory of your
  252. project and it will find all the app message files that were created by
  253. :djadmin:`makemessages`.
  254. * :ttag:`blocktrans` supports assigning its output to a variable using
  255. ``asvar``.
  256. Management Commands
  257. ^^^^^^^^^^^^^^^^^^^
  258. * The new :djadmin:`sendtestemail` command lets you send a test email to
  259. easily confirm that email sending through Django is working.
  260. * To increase the readability of the SQL code generated by
  261. :djadmin:`sqlmigrate`, the SQL code generated for each migration operation is
  262. preceded by the operation's description.
  263. * The :djadmin:`dumpdata` command output is now deterministically ordered.
  264. * The :djadmin:`createcachetable` command now has a ``--dry-run`` flag to
  265. print out the SQL rather than execute it.
  266. * The :djadmin:`startapp` command creates an ``apps.py`` file and adds
  267. ``default_app_config`` in ``__init__.py``.
  268. * When using the PostgreSQL backend, the :djadmin:`dbshell` command can connect
  269. to the database using the password from your settings file (instead of
  270. requiring it to be manually entered).
  271. Migrations
  272. ^^^^^^^^^^
  273. * Initial migrations are now marked with an :attr:`initial = True
  274. <django.db.migrations.Migration.initial>` class attribute which allows
  275. :djadminopt:`migrate --fake-initial <--fake-initial>` to more easily detect
  276. initial migrations.
  277. Models
  278. ^^^^^^
  279. * :meth:`QuerySet.bulk_create() <django.db.models.query.QuerySet.bulk_create>`
  280. now works on proxy models.
  281. * Database configuration gained a :setting:`TIME_ZONE <DATABASE-TIME_ZONE>`
  282. option for interacting with databases that store datetimes in local time and
  283. don't support time zones when :setting:`USE_TZ` is ``True``.
  284. * Added the :meth:`RelatedManager.set()
  285. <django.db.models.fields.related.RelatedManager.set()>` method to the related
  286. managers created by ``ForeignKey``, ``GenericForeignKey``, and
  287. ``ManyToManyField``.
  288. * Added the ``keep_parents`` parameter to :meth:`Model.delete()
  289. <django.db.models.Model.delete>` to allow deleting only a child's data in a
  290. model that uses multi-table inheritance.
  291. * :meth:`Model.delete() <django.db.models.Model.delete>`
  292. and :meth:`QuerySet.delete() <django.db.models.query.QuerySet.delete>` return
  293. the number of objects deleted.
  294. * Added a system check to prevent defining both ``Meta.ordering`` and
  295. ``order_with_respect_to`` on the same model.
  296. * :lookup:`Date and time <year>` lookups can be chained with other lookups
  297. (such as :lookup:`exact`, :lookup:`gt`, :lookup:`lt`, etc.). For example:
  298. ``Entry.objects.filter(pub_date__month__gt=6)``.
  299. * Time lookups (hour, minute, second) are now supported by
  300. :class:`~django.db.models.TimeField` for all database backends. Support for
  301. backends other than SQLite was added but undocumented in Django 1.7.
  302. * You can specify the ``output_field`` parameter of the
  303. :class:`~django.db.models.Avg` aggregate in order to aggregate over
  304. non-numeric columns, such as ``DurationField``.
  305. * Added the :lookup:`date` lookup to :class:`~django.db.models.DateTimeField`
  306. to allow querying the field by only the date portion.
  307. * Added the :class:`~django.db.models.functions.Greatest` and
  308. :class:`~django.db.models.functions.Least` database functions.
  309. * Added the :class:`~django.db.models.functions.Now` database function, which
  310. returns the current date and time.
  311. CSRF
  312. ^^^^
  313. * The request header's name used for CSRF authentication can be customized
  314. with :setting:`CSRF_HEADER_NAME`.
  315. Signals
  316. ^^^^^^^
  317. * ...
  318. Templates
  319. ^^^^^^^^^
  320. * Template tags created with the :meth:`~django.template.Library.simple_tag`
  321. helper can now store results in a template variable by using the ``as``
  322. argument.
  323. * Added a :meth:`Context.setdefault() <django.template.Context.setdefault>`
  324. method.
  325. * A warning will now be logged for missing context variables. These messages
  326. will be logged to the :ref:`django.template <django-template-logger>` logger.
  327. * The :ttag:`firstof` template tag supports storing the output in a variable
  328. using 'as'.
  329. * :meth:`Context.update() <django.template.Context.update>` can now be used as
  330. a context manager.
  331. * Django template loaders can now extend templates recursively.
  332. * The debug page template postmortem now include output from each engine that
  333. is installed.
  334. * :ref:`Debug page integration <template-debug-integration>` for custom
  335. template engines was added.
  336. * The :class:`~django.template.backends.django.DjangoTemplates` backend gained
  337. the ability to register libraries and builtins explicitly through the
  338. template :setting:`OPTIONS <TEMPLATES-OPTIONS>`.
  339. * The ``timesince`` and ``timeuntil`` filters were improved to deal with leap
  340. years when given large time spans.
  341. * The ``include`` tag now caches parsed templates objects during template
  342. rendering, speeding up reuse in places such as for loops.
  343. Requests and Responses
  344. ^^^^^^^^^^^^^^^^^^^^^^
  345. * Unless :attr:`HttpResponse.reason_phrase
  346. <django.http.HttpResponse.reason_phrase>` is explicitly set, it now is
  347. determined by the current value of :attr:`HttpResponse.status_code
  348. <django.http.HttpResponse.status_code>`. Modifying the value of
  349. ``status_code`` outside of the constructor will also modify the value of
  350. ``reason_phrase``.
  351. * The debug view now shows details of chained exceptions on Python 3.
  352. * The default 40x error views now accept a second positional parameter, the
  353. exception that triggered the view.
  354. * View error handlers now support
  355. :class:`~django.template.response.TemplateResponse`, commonly used with
  356. class-based views.
  357. * Exceptions raised by the ``render()`` method are now passed to the
  358. ``process_exception()`` method of each middleware.
  359. * Request middleware can now set :attr:`HttpRequest.urlconf
  360. <django.http.HttpRequest.urlconf>` to ``None`` to revert any changes made
  361. by previous middleware and return to using the :setting:`ROOT_URLCONF`.
  362. * The :setting:`DISALLOWED_USER_AGENTS` check in
  363. :class:`~django.middleware.common.CommonMiddleware` now raises a
  364. :class:`~django.core.exceptions.PermissionDenied` exception as opposed to
  365. returning an :class:`~django.http.HttpResponseForbidden` so that
  366. :data:`~django.conf.urls.handler403` is invoked.
  367. Tests
  368. ^^^^^
  369. * Added the :meth:`json() <django.test.Response.json>` method to test client
  370. responses to give access to the response body as JSON.
  371. * Added the :meth:`~django.test.Client.force_login()` method to the test
  372. client. Use this method to simulate the effect of a user logging into the
  373. site while skipping the authentication and verification steps of
  374. :meth:`~django.test.Client.login()`.
  375. URLs
  376. ^^^^
  377. * Regular expression lookaround assertions are now allowed in URL patterns.
  378. * The application namespace can now be set using an ``app_name`` attribute
  379. on the included module or object. It can also be set by passing a 2-tuple
  380. of (<list of patterns>, <application namespace>) as the first argument to
  381. :func:`~django.conf.urls.include`.
  382. Validators
  383. ^^^^^^^^^^
  384. * Added :func:`django.core.validators.int_list_validator` to generate
  385. validators of strings containing integers separated with a custom character.
  386. * :class:`~django.core.validators.EmailValidator` now limits the length of
  387. domain name labels to 63 characters per :rfc:`1034`.
  388. Backwards incompatible changes in 1.9
  389. =====================================
  390. .. warning::
  391. In addition to the changes outlined in this section, be sure to review the
  392. :doc:`deprecation timeline </internals/deprecation>` for any features that
  393. have been removed. If you haven't updated your code within the
  394. deprecation timeline for a given feature, its removal may appear as a
  395. backwards incompatible change.
  396. Database backend API
  397. ~~~~~~~~~~~~~~~~~~~~
  398. * A couple of new tests rely on the ability of the backend to introspect column
  399. defaults (returning the result as ``Field.default``). You can set the
  400. ``can_introspect_default`` database feature to ``False`` if your backend
  401. doesn't implement this. You may want to review the implementation on the
  402. backends that Django includes for reference (:ticket:`24245`).
  403. * Registering a global adapter or converter at the level of the DB-API module
  404. to handle time zone information of :class:`~datetime.datetime` values passed
  405. as query parameters or returned as query results on databases that don't
  406. support time zones is discouraged. It can conflict with other libraries.
  407. The recommended way to add a time zone to :class:`~datetime.datetime` values
  408. fetched from the database is to register a converter for ``DateTimeField``
  409. in ``DatabaseOperations.get_db_converters()``.
  410. The ``needs_datetime_string_cast`` database feature was removed. Database
  411. backends that set it must register a converter instead, as explained above.
  412. * The ``DatabaseOperations.value_to_db_<type>()`` methods were renamed to
  413. ``adapt_<type>field_value()`` to mirror the ``convert_<type>field_value()``
  414. methods.
  415. * To use the new ``date`` lookup, third-party database backends may need to
  416. implement the ``DatabaseOperations.datetime_cast_date_sql()`` method.
  417. * The ``DatabaseOperations.time_extract_sql()`` method was added. It calls the
  418. existing ``date_extract_sql()`` method. This method is overridden by the
  419. SQLite backend to add time lookups (hour, minute, second) to
  420. :class:`~django.db.models.TimeField`, and may be needed by third-party
  421. database backends.
  422. * The ``DatabaseOperations.datetime_cast_sql()`` method (not to be confused
  423. with ``DatabaseOperations.datetime_cast_date_sql()`` mentioned above)
  424. has been removed. This method served to format dates on Oracle long
  425. before 1.0, but hasn't been overridden by any core backend in years
  426. and hasn't been called anywhere in Django's code or tests.
  427. Default settings that were tuples are now lists
  428. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  429. The default settings in ``django.conf.global_settings`` were a combination of
  430. lists and tuples. All settings that were formerly tuples are now lists.
  431. ``is_usable`` attribute on template loaders is removed
  432. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  433. Django template loaders previously required an ``is_usable`` attribute to be
  434. defined. If a loader was configured in the template settings and this attribute
  435. was ``False``, the loader would be silently ignored. In practice, this was only
  436. used by the egg loader to detect if setuptools was installed. The ``is_usable``
  437. attribute is now removed and the egg loader instead fails at runtime if
  438. setuptools is not installed.
  439. Related set direct assignment
  440. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  441. :ref:`Direct assignment <direct-assignment>`) used to perform a ``clear()``
  442. followed by a call to ``add()``. This caused needlessly large data changes
  443. and prevented using the :data:`~django.db.models.signals.m2m_changed` signal
  444. to track individual changes in many-to-many relations.
  445. Direct assignment now relies on the the new
  446. :meth:`django.db.models.fields.related.RelatedManager.set()` method on
  447. related managers which by default only processes changes between the
  448. existing related set and the one that's newly assigned. The previous behavior
  449. can be restored by replacing direct assignment by a call to ``set()`` with
  450. the keyword argument ``clear=True``.
  451. ``ModelForm``, and therefore ``ModelAdmin``, internally rely on direct
  452. assignment for many-to-many relations and as a consequence now use the new
  453. behavior.
  454. Filesystem-based template loaders catch more specific exceptions
  455. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  456. When using the :class:`filesystem.Loader <django.template.loaders.filesystem.Loader>`
  457. or :class:`app_directories.Loader <django.template.loaders.app_directories.Loader>`
  458. template loaders, earlier versions of Django raised a
  459. :exc:`~django.template.TemplateDoesNotExist` error if a template source existed
  460. but was unreadable. This could happen under many circumstances, such as if
  461. Django didn't have permissions to open the file, or if the template source was
  462. a directory. Now, Django only silences the exception if the template source
  463. does not exist. All other situations result in the original ``IOError`` being
  464. raised.
  465. HTTP redirects no longer forced to absolute URIs
  466. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  467. Relative redirects are no longer converted to absolute URIs. :rfc:`2616`
  468. required the ``Location`` header in redirect responses to be an absolute URI,
  469. but it has been superseded by :rfc:`7231` which allows relative URIs in
  470. ``Location``, recognizing the actual practice of user agents, almost all of
  471. which support them.
  472. Consequently, the expected URLs passed to ``assertRedirects`` should generally
  473. no longer include the scheme and domain part of the URLs. For example,
  474. ``self.assertRedirects(response, 'http://testserver/some-url/')`` should be
  475. replaced by ``self.assertRedirects(response, '/some-url/')`` (unless the
  476. redirection specifically contained an absolute URL, of course).
  477. Dropped support for PostgreSQL 9.0
  478. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  479. Upstream support for PostgreSQL 9.0 ended in September 2015. As a consequence,
  480. Django 1.9 sets 9.1 as the minimum PostgreSQL version it officially supports.
  481. Template ``LoaderOrigin`` and ``StringOrigin`` are removed
  482. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  483. In previous versions of Django, when a template engine was initialized with
  484. debug as ``True``, an instance of ``django.template.loader.LoaderOrigin`` or
  485. ``django.template.base.StringOrigin`` was set as the origin attribute on the
  486. template object. These classes have been combined into
  487. :class:`~django.template.base.Origin` and is now always set regardless of the
  488. engine debug setting.
  489. .. _default-logging-changes-19:
  490. Changes to the default logging configuration
  491. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  492. To make it easier to write custom logging configurations, Django's default
  493. logging configuration no longer defines 'django.request' and 'django.security'
  494. loggers. Instead, it defines a single 'django' logger with two handlers:
  495. * 'console': filtered at the ``INFO`` level and only active if ``DEBUG=True``.
  496. * 'mail_admins': filtered at the ``ERROR`` level and only active if
  497. ``DEBUG=False``.
  498. If you aren't overriding Django's default logging, you should see minimal
  499. changes in behavior, but you might see some new logging to the ``runserver``
  500. console, for example.
  501. If you are overriding Django's default logging, you should check to see how
  502. your configuration merges with the new defaults.
  503. Removal of time zone aware global adapters and converters for datetimes
  504. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  505. Django no longer registers global adapters and converters for managing time
  506. zone information on :class:`~datetime.datetime` values sent to the database as
  507. query parameters or read from the database in query results. This change
  508. affects projects that meet all the following conditions:
  509. * The :setting:`USE_TZ` setting is ``True``.
  510. * The database is SQLite, MySQL, Oracle, or a third-party database that
  511. doesn't support time zones. In doubt, you can check the value of
  512. ``connection.features.supports_timezones``.
  513. * The code queries the database outside of the ORM, typically with
  514. ``cursor.execute(sql, params)``.
  515. If you're passing aware :class:`~datetime.datetime` parameters to such
  516. queries, you should turn them into naive datetimes in UTC::
  517. from django.utils import timezone
  518. param = timezone.make_naive(param, timezone.utc)
  519. If you fail to do so, Django 1.9 and 2.0 will perform the conversion like
  520. earlier versions but emit a deprecation warning. Django 2.0 won't perform any
  521. conversion, which may result in data corruption.
  522. If you're reading :class:`~datetime.datetime` values from the results, they
  523. will be naive instead of aware. You can compensate as follows::
  524. from django.utils import timezone
  525. value = timezone.make_aware(value, timezone.utc)
  526. You don't need any of this if you're querying the database through the ORM,
  527. even if you're using :meth:`raw() <django.db.models.query.QuerySet.raw>`
  528. queries. The ORM takes care of managing time zone information.
  529. Template tag modules are imported when templates are configured
  530. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  531. The :class:`~django.template.backends.django.DjangoTemplates` backend now
  532. performs discovery on installed template tag modules when instantiated. This
  533. update enables libraries to be provided explicitly via the ``'libraries'``
  534. key of :setting:`OPTIONS <TEMPLATES-OPTIONS>` when defining a
  535. :class:`~django.template.backends.django.DjangoTemplates` backend. Import
  536. or syntax errors in template tag modules now fail early at instantiation time
  537. rather than when a template with a :ttag:`{% load %}<load>` tag is first
  538. compiled.
  539. ``django.template.base.add_to_builtins()`` is removed
  540. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  541. Although it was a private API, projects commonly used ``add_to_builtins()`` to
  542. make template tags and filters available without using the
  543. :ttag:`{% load %}<load>` tag. This API has been formalized. Projects should now
  544. define built-in libraries via the ``'builtins'`` key of :setting:`OPTIONS
  545. <TEMPLATES-OPTIONS>` when defining a
  546. :class:`~django.template.backends.django.DjangoTemplates` backend.
  547. .. _simple-tag-conditional-escape-fix:
  548. ``simple_tag`` now wraps tag output in ``conditional_escape``
  549. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  550. In general, template tags do not autoescape their contents, and this behavior is
  551. :ref:`documented <tags-auto-escaping>`. For tags like
  552. :class:`~django.template.Library.inclusion_tag`, this is not a problem because
  553. the included template will perform autoescaping. For
  554. :class:`~django.template.Library.assignment_tag`, the output will be escaped
  555. when it is used as a variable in the template.
  556. For the intended use cases of :class:`~django.template.Library.simple_tag`,
  557. however, it is very easy to end up with incorrect HTML and possibly an XSS
  558. exploit. For example::
  559. @register.simple_tag(takes_context=True)
  560. def greeting(context):
  561. return "Hello {0}!".format(context['request'].user.first_name)
  562. In older versions of Django, this will be an XSS issue because
  563. ``user.first_name`` is not escaped.
  564. In Django 1.9, this is fixed: if the template context has ``autoescape=True``
  565. set (the default), then ``simple_tag`` will wrap the output of the tag function
  566. with :func:`~django.utils.html.conditional_escape`.
  567. To fix your ``simple_tag``\s, it is best to apply the following practices:
  568. * Any code that generates HTML should use either the template system or
  569. :func:`~django.utils.html.format_html`.
  570. * If the output of a ``simple_tag`` needs escaping, use
  571. :func:`~django.utils.html.escape` or
  572. :func:`~django.utils.html.conditional_escape`.
  573. * If you are absolutely certain that you are outputting HTML from a trusted
  574. source (e.g. a CMS field that stores HTML entered by admins), you can mark it
  575. as such using :func:`~django.utils.safestring.mark_safe`.
  576. Tags that follow these rules will be correct and safe whether they are run on
  577. Django 1.9+ or earlier.
  578. ``Paginator.page_range``
  579. ~~~~~~~~~~~~~~~~~~~~~~~~
  580. :attr:`Paginator.page_range <django.core.paginator.Paginator.page_range>` is
  581. now an iterator instead of a list.
  582. In versions of Django previous to 1.8, ``Paginator.page_range`` returned a
  583. ``list`` in Python 2 and a ``range`` in Python 3. Django 1.8 consistently
  584. returned a list, but an iterator is more efficient.
  585. Existing code that depends on ``list`` specific features, such as indexing,
  586. can be ported by converting the iterator into a ``list`` using ``list()``.
  587. Miscellaneous
  588. ~~~~~~~~~~~~~
  589. * CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have
  590. been removed as these browsers have reached end-of-life.
  591. * The jQuery static files in ``contrib.admin`` have been moved into a
  592. ``vendor/jquery`` subdirectory.
  593. * The text displayed for null columns in the admin changelist ``list_display``
  594. cells has changed from ``(None)`` (or its translated equivalent) to ``-``.
  595. * ``django.http.responses.REASON_PHRASES`` and
  596. ``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use
  597. Python's stdlib instead: :data:`http.client.responses` for Python 3 and
  598. `httplib.responses`_ for Python 2.
  599. .. _`httplib.responses`: https://docs.python.org/2/library/httplib.html#httplib.responses
  600. * ``ValuesQuerySet`` and ``ValuesListQuerySet`` have been removed.
  601. * The ``admin/base.html`` template no longer sets
  602. ``window.__admin_media_prefix__``. Image references in JavaScript that used
  603. that value to construct absolute URLs have been moved to CSS for easier
  604. customization.
  605. * ``CommaSeparatedIntegerField`` validation has been refined to forbid values
  606. like ``','``, ``',1'``, and ``'1,,2'``.
  607. * Form initialization was moved from the :meth:`ProcessFormView.get()
  608. <django.views.generic.edit.ProcessFormView.get>` method to the new
  609. :meth:`FormMixin.get_context_data()
  610. <django.views.generic.edit.FormMixin.get_context_data>` method. This may be
  611. backwards incompatible if you have overridden the ``get_context_data()``
  612. method without calling ``super()``.
  613. * Support for PostGIS 1.5 has been dropped.
  614. * The ``django.contrib.sites.models.Site.domain`` field was changed to be
  615. :attr:`~django.db.models.Field.unique`.
  616. * In order to enforce test isolation, database queries are not allowed
  617. by default in :class:`~django.test.SimpleTestCase` tests anymore. You
  618. can disable this behavior by setting the
  619. :attr:`~django.test.SimpleTestCase.allow_database_queries` class attribute
  620. to ``True`` on your test class.
  621. * :attr:`ResolverMatch.app_name
  622. <django.core.urlresolvers.ResolverMatch.app_name>` was changed to contain
  623. the full namespace path in the case of nested namespaces. For consistency
  624. with :attr:`ResolverMatch.namespace
  625. <django.core.urlresolvers.ResolverMatch.namespace>`, the empty value is now
  626. an empty string instead of ``None``.
  627. * For security hardening, session keys must be at least 8 characters.
  628. * Private function ``django.utils.functional.total_ordering()`` has been
  629. removed. It contained a workaround for a ``functools.total_ordering()`` bug
  630. in Python versions older than 2.7.3.
  631. * XML serialization (either through :djadmin:`dumpdata` or the syndication
  632. framework) used to output any characters it received. Now if the content to
  633. be serialized contains any control characters not allowed in the XML 1.0
  634. standard, the serialization will fail with a :exc:`ValueError`.
  635. * :class:`~django.forms.CharField` now strips input of leading and trailing
  636. whitespace by default. This can be disabled by setting the new
  637. :attr:`~django.forms.CharField.strip` argument to ``False``.
  638. .. _deprecated-features-1.9:
  639. Features deprecated in 1.9
  640. ==========================
  641. ``assignment_tag()``
  642. ~~~~~~~~~~~~~~~~~~~~
  643. Django 1.4 added the ``assignment_tag`` helper to ease the creation of
  644. template tags that store results in a template variable. The
  645. :meth:`~django.template.Library.simple_tag` helper has gained this same
  646. ability, making the ``assignment_tag`` obsolete. Tags that use
  647. ``assignment_tag`` should be updated to use ``simple_tag``.
  648. ``{% cycle %}`` syntax with comma-separated arguments
  649. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  650. The :ttag:`cycle` tag supports an inferior old syntax from previous Django
  651. versions:
  652. .. code-block:: html+django
  653. {% cycle row1,row2,row3 %}
  654. Its parsing caused bugs with the current syntax, so support for the old syntax
  655. will be removed in Django 2.0 following an accelerated deprecation.
  656. ``Field.rel`` changes
  657. ~~~~~~~~~~~~~~~~~~~~~
  658. ``Field.rel`` and its methods and attributes have changed to match the related
  659. fields API. The ``Field.rel`` attribute is renamed to ``remote_field`` and many
  660. of its methods and attributes are either changed or renamed.
  661. The aim of these changes is to provide a documented API for relation fields.
  662. ``GeoManager`` and ``GeoQuerySet`` custom methods
  663. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  664. All custom ``GeoQuerySet`` methods (``area()``, ``distance()``, ``gml()``, ...)
  665. have been replaced by equivalent geographic expressions in annotations (see in
  666. new features). Hence the need to set a custom ``GeoManager`` to GIS-enabled
  667. models is now obsolete. As soon as your code doesn't call any of the deprecated
  668. methods, you can simply remove the ``objects = GeoManager()`` lines from your
  669. models.
  670. Template loader APIs have changed
  671. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  672. Django template loaders have been updated to allow recursive template
  673. extending. This change necessitated a new template loader API. The old
  674. ``load_template()`` and ``load_template_sources()`` methods are now deprecated.
  675. Details about the new API can be found :ref:`in the template loader
  676. documentation <custom-template-loaders>`.
  677. Passing a 3-tuple or an ``app_name`` to :func:`~django.conf.urls.include()`
  678. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  679. The instance namespace part of passing a tuple as the first argument has been
  680. replaced by passing the ``namespace`` argument to ``include()``. The
  681. ``app_name`` argument to ``include()`` has been replaced by passing a 2-tuple,
  682. or passing an object or module with an ``app_name`` attribute.
  683. If the ``app_name`` is set in this new way, the ``namespace`` argument is no
  684. longer required. It will default to the value of ``app_name``.
  685. This change also means that the old way of including an ``AdminSite`` instance
  686. is deprecated. Instead, pass ``admin.site.urls`` directly to
  687. :func:`~django.conf.urls.url()`:
  688. .. snippet::
  689. :filename: urls.py
  690. from django.conf.urls import url
  691. from django.contrib import admin
  692. urlpatterns = [
  693. url(r'^admin/', admin.site.urls),
  694. ]
  695. URL application namespace required if setting an instance namespace
  696. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  697. In the past, an instance namespace without an application namespace
  698. would serve the same purpose as the application namespace, but it was
  699. impossible to reverse the patterns if there was an application namespace
  700. with the same name. Includes that specify an instance namespace require that
  701. the included URLconf sets an application namespace.
  702. Miscellaneous
  703. ~~~~~~~~~~~~~
  704. * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has
  705. been deprecated as it has no effect.
  706. * The ``check_aggregate_support()`` method of
  707. ``django.db.backends.base.BaseDatabaseOperations`` has been deprecated and
  708. will be removed in Django 2.0. The more general ``check_expression_support()``
  709. should be used instead.
  710. * ``django.forms.extras`` is deprecated. You can find
  711. :class:`~django.forms.SelectDateWidget` in ``django.forms.widgets``
  712. (or simply ``django.forms``) instead.
  713. * Private API ``django.db.models.fields.add_lazy_relation()`` is deprecated.
  714. * The ``django.contrib.auth.tests.utils.skipIfCustomUser()`` decorator is
  715. deprecated. With the test discovery changes in Django 1.6, the tests for
  716. ``django.contrib`` apps are no longer run as part of the user's project.
  717. Therefore, the ``@skipIfCustomUser`` decorator is no longer needed to
  718. decorate tests in ``django.contrib.auth``.
  719. * If you customized some :ref:`error handlers <error-views>`, the view
  720. signatures with only one request parameter are deprecated. The views should
  721. now also accept a second ``exception`` positional parameter.
  722. * The ``django.utils.feedgenerator.Atom1Feed.mime_type`` and
  723. ``django.utils.feedgenerator.RssFeed.mime_type`` attributes are deprecated in
  724. favor of ``content_type``.
  725. * :class:`~django.core.signing.Signer` now issues a warning if an invalid
  726. separator is used. This will become an exception in Django 1.10.
  727. .. removed-features-1.9:
  728. Features removed in 1.9
  729. =======================
  730. These features have reached the end of their deprecation cycle and so have been
  731. removed in Django 1.9 (please see the :ref:`deprecation timeline
  732. <deprecation-removed-in-1.9>` for more details):
  733. * ``django.utils.dictconfig`` is removed.
  734. * ``django.utils.importlib`` is removed.
  735. * ``django.utils.tzinfo`` is removed.
  736. * ``django.utils.unittest`` is removed.
  737. * The ``syncdb`` command is removed.
  738. * ``django.db.models.signals.pre_syncdb`` and
  739. ``django.db.models.signals.post_syncdb`` is removed.
  740. * Support for ``allow_syncdb`` on database routers is removed.
  741. * The legacy method of syncing apps without migrations is removed,
  742. and migrations are compulsory for all apps. This includes automatic
  743. loading of ``initial_data`` fixtures and support for initial SQL data.
  744. * All models need to be defined inside an installed application or declare an
  745. explicit :attr:`~django.db.models.Options.app_label`. Furthermore, it isn't
  746. possible to import them before their application is loaded. In particular, it
  747. isn't possible to import models inside the root package of an application.
  748. * The model and form ``IPAddressField`` is removed. A stub field remains for
  749. compatibility with historical migrations.
  750. * ``AppCommand.handle_app()`` is no longer be supported.
  751. * ``RequestSite`` and ``get_current_site()`` are no longer importable from
  752. ``django.contrib.sites.models``.
  753. * FastCGI support via the ``runfcgi`` management command is removed.
  754. * ``django.utils.datastructures.SortedDict`` is removed.
  755. * ``ModelAdmin.declared_fieldsets`` is removed.
  756. * The ``util`` modules that provided backwards compatibility are removed:
  757. * ``django.contrib.admin.util``
  758. * ``django.contrib.gis.db.backends.util``
  759. * ``django.db.backends.util``
  760. * ``django.forms.util``
  761. * ``ModelAdmin.get_formsets`` is removed.
  762. * The backward compatible shims introduced to rename the
  763. ``BaseMemcachedCache._get_memcache_timeout()`` method to
  764. ``get_backend_timeout()`` is removed.
  765. * The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` are removed.
  766. * The ``use_natural_keys`` argument for ``serializers.serialize()`` is removed.
  767. * Private API ``django.forms.forms.get_declared_fields()`` is removed.
  768. * The ability to use a ``SplitDateTimeWidget`` with ``DateTimeField`` is
  769. removed.
  770. * The ``WSGIRequest.REQUEST`` property is removed.
  771. * The class ``django.utils.datastructures.MergeDict`` is removed.
  772. * The ``zh-cn`` and ``zh-tw`` language codes are removed.
  773. * The internal ``django.utils.functional.memoize()`` is removed.
  774. * ``django.core.cache.get_cache`` is removed.
  775. * ``django.db.models.loading`` is removed.
  776. * Passing callable arguments to querysets is no longer possible.
  777. * ``BaseCommand.requires_model_validation`` is removed in favor of
  778. ``requires_system_checks``. Admin validators is replaced by admin checks.
  779. * The ``ModelAdmin.validator_class`` and ``default_validator_class`` attributes
  780. are removed.
  781. * ``ModelAdmin.validate()`` is removed.
  782. * ``django.db.backends.DatabaseValidation.validate_field`` is removed in
  783. favor of the ``check_field`` method.
  784. * The ``validate`` management command is removed.
  785. * ``django.utils.module_loading.import_by_path`` is removed in favor of
  786. ``django.utils.module_loading.import_string``.
  787. * ``ssi`` and ``url`` template tags are removed from the ``future`` template
  788. tag library.
  789. * ``django.utils.text.javascript_quote()`` is removed.
  790. * Database test settings as independent entries in the database settings,
  791. prefixed by ``TEST_``, are no longer supported.
  792. * The `cache_choices` option to :class:`~django.forms.ModelChoiceField` and
  793. :class:`~django.forms.ModelMultipleChoiceField` is removed.
  794. * The default value of the
  795. :attr:`RedirectView.permanent <django.views.generic.base.RedirectView.permanent>`
  796. attribute has changed from ``True`` to ``False``.
  797. * ``django.contrib.sitemaps.FlatPageSitemap`` is removed in favor of
  798. ``django.contrib.flatpages.sitemaps.FlatPageSitemap``.
  799. * Private API ``django.test.utils.TestTemplateLoader`` is removed.
  800. * The ``django.contrib.contenttypes.generic`` module is removed.