1.9.txt 43 KB

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