1.10.txt 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152
  1. =============================================
  2. Django 1.10 release notes - UNDER DEVELOPMENT
  3. =============================================
  4. Welcome to Django 1.10!
  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.9 or older versions. We've :ref:`dropped some features<removed-features-1.10>`
  8. that have reached the end of their deprecation cycle, and we've `begun the
  9. deprecation process for some features`_.
  10. .. _`new features`: `What's new in Django 1.10`_
  11. .. _`backwards incompatible changes`: `Backwards incompatible changes in 1.10`_
  12. .. _`dropped some features`: `Features removed in 1.10`_
  13. .. _`begun the deprecation process for some features`: `Features deprecated in 1.10`_
  14. Python compatibility
  15. ====================
  16. Like Django 1.9, Django 1.10 requires Python 2.7, 3.4, or 3.5. We **highly
  17. recommend** and only officially support the latest release of each series.
  18. What's new in Django 1.10
  19. =========================
  20. Full text search for PostgreSQL
  21. -------------------------------
  22. ``django.contrib.postgres`` now includes a :doc:`collection of database
  23. functions </ref/contrib/postgres/search>` to allow the use of the full text
  24. search engine. You can search across multiple fields in your relational
  25. database, combine the searches with other lookups, use different language
  26. configurations and weightings, and rank the results by relevance.
  27. Minor features
  28. --------------
  29. :mod:`django.contrib.admin`
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. * For sites running on a subpath, the default :attr:`URL for the "View site"
  32. link <django.contrib.admin.AdminSite.site_url>` at the top of each admin page
  33. will now point to ``request.META['SCRIPT_NAME']`` if set, instead of ``/``.
  34. * The success message that appears after adding or editing an object now
  35. contains a link to the object's change form.
  36. * All inline JavaScript is removed so you can enable the
  37. ``Content-Security-Policy`` HTTP header if you wish.
  38. * The new :attr:`InlineModelAdmin.classes
  39. <django.contrib.admin.InlineModelAdmin.classes>` attribute allows specifying
  40. classes on inline fieldsets. Inlines with a ``collapse`` class will be
  41. initially collapsed and their header will have a small "show" link.
  42. * If a user doesn't have the add permission, the ``object-tools`` block on a
  43. model's changelist will now be rendered (without the add button, of course).
  44. This makes it easier to add custom tools in this case.
  45. * The :class:`~django.contrib.admin.models.LogEntry` model now stores change
  46. messages in a JSON structure so that the message can be dynamically translated
  47. using the current active language. A new ``LogEntry.get_change_message()``
  48. method is now the preferred way of retrieving the change message.
  49. * Selected objects for fields in ``ModelAdmin.raw_id_fields`` now have a link
  50. to object's change form.
  51. * Added "No date" and "Has date" choices for ``DateFieldListFilter`` if the
  52. field is nullable.
  53. :mod:`django.contrib.admindocs`
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. * ...
  56. :mod:`django.contrib.auth`
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. * Added support for the :ref:`Argon2 password hash <argon2_usage>`. It's
  59. recommended over PBKDF2, however, it's not the default as it requires a
  60. third-party library.
  61. * The default iteration count for the PBKDF2 password hasher has been increased
  62. by 25%. This backwards compatible change will not affect users who have
  63. subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to change the
  64. default value.
  65. * The :func:`~django.contrib.auth.views.logout` view sends "no-cache" headers
  66. to prevent an issue where Safari caches redirects and prevents a user from
  67. being able to log out.
  68. * Added the optional ``backend`` argument to :func:`~django.contrib.auth.login`
  69. to allow using it without credentials.
  70. * The new :setting:`LOGOUT_REDIRECT_URL` setting controls the redirect of the
  71. :func:`~django.contrib.auth.views.logout` view, if the view doesn't get a
  72. ``next_page`` argument.
  73. * The new ``redirect_authenticated_user`` parameter for the
  74. :func:`~django.contrib.auth.views.login` view allows redirecting
  75. authenticated users visiting the login page.
  76. :mod:`django.contrib.contenttypes`
  77. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. * ...
  79. :mod:`django.contrib.gis`
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~
  81. * :ref:`Distance lookups <distance-lookups>` now accept expressions as the
  82. distance value parameter.
  83. * The new :attr:`GEOSGeometry.unary_union
  84. <django.contrib.gis.geos.GEOSGeometry.unary_union>` property computes the
  85. union of all the elements of this geometry.
  86. * Added the :meth:`GEOSGeometry.covers()
  87. <django.contrib.gis.geos.GEOSGeometry.covers>` binary predicate.
  88. * Added the :meth:`GDALBand.statistics()
  89. <django.contrib.gis.gdal.GDALBand.statistics>` method and
  90. :attr:`~django.contrib.gis.gdal.GDALBand.mean`
  91. and :attr:`~django.contrib.gis.gdal.GDALBand.std` attributes.
  92. * Added support for the :class:`~django.contrib.gis.db.models.MakeLine`
  93. aggregate and :class:`~django.contrib.gis.db.models.functions.GeoHash`
  94. function on SpatiaLite.
  95. * Added support for the
  96. :class:`~django.contrib.gis.db.models.functions.Difference`,
  97. :class:`~django.contrib.gis.db.models.functions.Intersection`, and
  98. :class:`~django.contrib.gis.db.models.functions.SymDifference`
  99. functions on MySQL.
  100. * Added support for instantiating empty GEOS geometries.
  101. * The new :attr:`~django.contrib.gis.geos.WKTWriter.trim` and
  102. :attr:`~django.contrib.gis.geos.WKTWriter.precision` properties
  103. of :class:`~django.contrib.gis.geos.WKTWriter` allow controlling
  104. output of the fractional part of the coordinates in WKT.
  105. * Added the :attr:`LineString.closed
  106. <django.contrib.gis.geos.LineString.closed>` and
  107. :attr:`MultiLineString.closed
  108. <django.contrib.gis.geos.MultiLineString.closed>` properties.
  109. * The :doc:`GeoJSON serializer </ref/contrib/gis/serializers>` now outputs the
  110. primary key of objects in the ``properties`` dictionary if specific fields
  111. aren't specified.
  112. * The ability to replicate input data on the :meth:`GDALBand.data()
  113. <django.contrib.gis.gdal.GDALBand.data>` method was added. Band data can
  114. now be updated with repeated values efficiently.
  115. * Added database functions
  116. :class:`~django.contrib.gis.db.models.functions.IsValid` and
  117. :class:`~django.contrib.gis.db.models.functions.MakeValid`, as well as the
  118. :lookup:`isvalid` lookup, all for PostGIS. This allows filtering and
  119. repairing invalid geometries on the database side.
  120. :mod:`django.contrib.messages`
  121. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. * ...
  123. :mod:`django.contrib.postgres`
  124. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. * For convenience, :class:`~django.contrib.postgres.fields.HStoreField` now
  126. casts its keys and values to strings.
  127. :mod:`django.contrib.redirects`
  128. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129. * ...
  130. :mod:`django.contrib.sessions`
  131. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  132. * The :djadmin:`clearsessions` management command now removes file-based
  133. sessions.
  134. :mod:`django.contrib.sitemaps`
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. * ...
  137. :mod:`django.contrib.sites`
  138. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. * The :class:`~django.contrib.sites.models.Site` model now supports
  140. :ref:`natural keys <topics-serialization-natural-keys>`.
  141. :mod:`django.contrib.staticfiles`
  142. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. * The :ttag:`static` template tag now uses ``django.contrib.staticfiles``
  144. if it's in ``INSTALLED_APPS``. This is especially useful for third-party apps
  145. which can now always use ``{% load static %}`` (instead of
  146. ``{% load staticfiles %}`` or ``{% load static from staticfiles %}``) and
  147. not worry about whether or not the ``staticfiles`` app is installed.
  148. :mod:`django.contrib.syndication`
  149. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  150. * ...
  151. Cache
  152. ~~~~~
  153. * The file-based cache backend now uses the highest pickling protocol.
  154. CSRF
  155. ~~~~
  156. * The default :setting:`CSRF_FAILURE_VIEW`, ``views.csrf.csrf_failure()`` now
  157. accepts an optional ``template_name`` parameter, defaulting to
  158. ``'403_csrf.html'``, to control the template used to render the page.
  159. Database backends
  160. ~~~~~~~~~~~~~~~~~
  161. * Temporal data subtraction was unified on all backends.
  162. * If the database supports it, backends can set
  163. ``DatabaseFeatures.can_return_ids_from_bulk_insert=True`` and implement
  164. ``DatabaseOperations.fetch_returned_insert_ids()`` to set primary keys
  165. on objects created using ``QuerySet.bulk_create()``.
  166. * Added keyword arguments to the ``as_sql()`` methods of various expressions
  167. (``Func``, ``When``, ``Case``, and ``OrderBy``) to allow database backends to
  168. customize them without mutating ``self``, which isn't safe when using
  169. different database backends. See the ``arg_joiner`` and ``**extra_context``
  170. parameters of :meth:`Func.as_sql() <django.db.models.Func.as_sql>` for an
  171. example.
  172. Email
  173. ~~~~~
  174. * ...
  175. File Storage
  176. ~~~~~~~~~~~~
  177. * Storage backends now present a timezone-aware API with new methods
  178. :meth:`~django.core.files.storage.Storage.get_accessed_time`,
  179. :meth:`~django.core.files.storage.Storage.get_created_time`, and
  180. :meth:`~django.core.files.storage.Storage.get_modified_time`. They return a
  181. timezone-aware ``datetime`` if :setting:`USE_TZ` is ``True`` and a naive
  182. ``datetime`` in the local timezone otherwise.
  183. File Uploads
  184. ~~~~~~~~~~~~
  185. * ...
  186. Forms
  187. ~~~~~
  188. * Form and widget ``Media`` is now served using
  189. :mod:`django.contrib.staticfiles` if installed.
  190. * The ``<input>`` tag rendered by :class:`~django.forms.CharField` now includes
  191. a ``minlength`` attribute if the field has a ``min_length``.
  192. * Required form fields now have the ``required`` HTML attribute. Set the new
  193. :attr:`Form.use_required_attribute <django.forms.Form.use_required_attribute>`
  194. attribute to ``False`` to disable it. The ``required`` attribute isn't
  195. included on forms of formsets because the browser validation may not be
  196. correct when adding and deleting formsets.
  197. Generic Views
  198. ~~~~~~~~~~~~~
  199. * The :class:`~django.views.generic.base.View` class can now be imported from
  200. ``django.views``.
  201. Internationalization
  202. ~~~~~~~~~~~~~~~~~~~~
  203. * The :func:`~django.conf.urls.i18n.i18n_patterns` helper function can now be
  204. used in a root URLConf specified using :attr:`request.urlconf
  205. <django.http.HttpRequest.urlconf>`.
  206. * By setting the new ``prefix_default_language`` parameter for
  207. :func:`~django.conf.urls.i18n.i18n_patterns` to ``False``, you can allow
  208. accessing the default language without a URL prefix.
  209. * :func:`~django.views.i18n.set_language` now returns a 204 status code (No
  210. Content) for AJAX requests when there is no ``next`` parameter in ``POST`` or
  211. ``GET``.
  212. * The :class:`~django.views.i18n.JavaScriptCatalog` and
  213. :class:`~django.views.i18n.JSONCatalog` class-based views supersede the
  214. deprecated ``javascript_catalog()`` and ``json_catalog()`` function-based
  215. views. The new views are almost equivalent to the old ones except that by
  216. default the new views collect all JavaScript strings in the ``djangojs``
  217. translation domain from all installed apps rather than only the JavaScript
  218. strings from :setting:`LOCALE_PATHS`.
  219. Management Commands
  220. ~~~~~~~~~~~~~~~~~~~
  221. * :func:`~django.core.management.call_command` now returns the value returned
  222. from the ``command.handle()`` method.
  223. * The new :option:`check --fail-level` option allows specifying the message
  224. level that will cause the command to exit with a non-zero status.
  225. * The new :option:`makemigrations --check` option makes the command exit
  226. with a non-zero status when model changes without migrations are detected.
  227. * :djadmin:`makemigrations` now displays the path to the migration files that
  228. it generates.
  229. * The :option:`shell --interface` option now accepts ``python`` to force use of
  230. the "plain" Python interpreter.
  231. * The new :option:`shell --command` option lets you run a command as Django and
  232. exit, instead of opening the interactive shell.
  233. * Added a warning to :djadmin:`dumpdata` if a proxy model is specified (which
  234. results in no output) without its concrete parent.
  235. * The new :attr:`BaseCommand.requires_migrations_checks
  236. <django.core.management.BaseCommand.requires_migrations_checks>` attribute
  237. may be set to ``True`` if you want your command to print a warning, like
  238. :djadmin:`runserver` does, if the set of migrations on disk don't match the
  239. migrations in the database.
  240. * To assist with testing, :func:`~django.core.management.call_command` now
  241. accepts a command object as the first argument.
  242. * The :djadmin:`shell` command supports tab completion on systems using
  243. ``libedit``, e.g. Mac OSX.
  244. * The :djadmin:`inspectdb` command lets you choose what tables should be
  245. inspected by specifying their names as arguments.
  246. Migrations
  247. ~~~~~~~~~~
  248. * Added support for serialization of ``enum.Enum`` objects.
  249. * Added the ``elidable`` argument to the
  250. :class:`~django.db.migrations.operations.RunSQL` and
  251. :class:`~django.db.migrations.operations.RunPython` operations to allow them
  252. to be removed when squashing migrations.
  253. * Added support for :ref:`non-atomic migrations <non-atomic-migrations>` by
  254. setting the ``atomic`` attribute on a ``Migration``.
  255. * The ``migrate`` and ``makemigrations`` commands now check for a consistent
  256. migration history. If they find some unapplied dependencies of an applied
  257. migration, ``InconsistentMigrationHistory`` is raised.
  258. Models
  259. ~~~~~~
  260. * Reverse foreign keys from proxy models are now propagated to their
  261. concrete class. The reverse relation attached by a
  262. :class:`~django.db.models.ForeignKey` pointing to a proxy model is now
  263. accessible as a descriptor on the proxied model class and may be referenced in
  264. queryset filtering.
  265. * The new :meth:`Field.rel_db_type() <django.db.models.Field.rel_db_type>`
  266. method returns the database column data type for fields such as ``ForeignKey``
  267. and ``OneToOneField`` that point to another field.
  268. * The :attr:`~django.db.models.Func.arity` class attribute is added to
  269. :class:`~django.db.models.Func`. This attribute can be used to set the number
  270. of arguments the function accepts.
  271. * Added :class:`~django.db.models.BigAutoField` which acts much like an
  272. :class:`~django.db.models.AutoField` except that it is guaranteed
  273. to fit numbers from ``1`` to ``9223372036854775807``.
  274. * :meth:`QuerySet.in_bulk() <django.db.models.query.QuerySet.in_bulk>`
  275. may be called without any arguments to return all objects in the queryset.
  276. * :attr:`~django.db.models.ForeignKey.related_query_name` now supports
  277. app label and class interpolation using the ``'%(app_label)s'`` and
  278. ``'%(class)s'`` strings.
  279. * The :func:`~django.db.models.prefetch_related_objects` function is now a
  280. public API.
  281. * :meth:`QuerySet.bulk_create() <django.db.models.query.QuerySet.bulk_create>`
  282. sets the primary key on objects when using PostgreSQL.
  283. * Added the :class:`~django.db.models.functions.Cast` database function.
  284. * A proxy model may now inherit multiple proxy models that share a common
  285. non-abstract parent class.
  286. Requests and Responses
  287. ~~~~~~~~~~~~~~~~~~~~~~
  288. * Added ``request.user`` to the debug view.
  289. * Added :class:`~django.http.HttpResponse` methods
  290. :meth:`~django.http.HttpResponse.readable()` and
  291. :meth:`~django.http.HttpResponse.seekable()` to make an instance a
  292. stream-like object and allow wrapping it with :py:class:`io.TextIOWrapper`.
  293. * Added the :attr:`HttpResponse.content_type
  294. <django.http.HttpRequest.content_type>` and
  295. :attr:`~django.http.HttpRequest.content_params` attributes which are
  296. parsed from the ``CONTENT_TYPE`` header.
  297. * The parser for ``request.COOKIES`` is simplified to better match the behavior
  298. of browsers. ``request.COOKIES`` may now contain cookies that are invalid
  299. according to :rfc:`6265` but are possible to set via ``document.cookie``.
  300. Serialization
  301. ~~~~~~~~~~~~~
  302. * The ``django.core.serializers.json.DjangoJSONEncoder`` now knows how to
  303. serialize lazy strings, typically used for translatable content.
  304. Signals
  305. ~~~~~~~
  306. * ...
  307. Templates
  308. ~~~~~~~~~
  309. * Added the ``autoescape`` option to the
  310. :class:`~django.template.backends.django.DjangoTemplates` backend and the
  311. :class:`~django.template.Engine` class.
  312. * Added the ``is`` and ``is not`` comparison operators to the :ttag:`if` tag.
  313. * Allowed :tfilter:`dictsort` to order a list of lists by an element at a
  314. specified index.
  315. * The :func:`~django.template.context_processors.debug` context processor
  316. contains queries for all database aliases instead of only the default alias.
  317. Tests
  318. ~~~~~
  319. * To better catch bugs, :class:`~django.test.TestCase` now checks deferrable
  320. database constraints at the end of each test.
  321. * Tests and test cases can be :ref:`marked with tags <topics-tagging-tests>`
  322. and run selectively with the new :option:`test --tag` and :option:`test
  323. --exclude-tag` options.
  324. * Added the :setting:`DATABASES['TEST']['MIGRATE'] <TEST_MIGRATE>` option to
  325. allow disabling of migrations during test database creation.
  326. * You can now login and use sessions with the test client even if
  327. :mod:`django.contrib.sessions` is not in :setting:`INSTALLED_APPS`.
  328. URLs
  329. ~~~~
  330. * An addition in :func:`django.setup()` allows URL resolving that happens
  331. outside of the request/response cycle (e.g. in management commands and
  332. standalone scripts) to take :setting:`FORCE_SCRIPT_NAME` into account when it
  333. is set.
  334. Validators
  335. ~~~~~~~~~~
  336. * :class:`~django.core.validators.URLValidator` now limits the length of
  337. domain name labels to 63 characters and the total length of domain
  338. names to 253 characters per :rfc:`1034`.
  339. * :func:`~django.core.validators.int_list_validator` now accepts an optional
  340. ``allow_negative`` boolean parameter, defaulting to ``False``, to allow
  341. negative integers.
  342. Backwards incompatible changes in 1.10
  343. ======================================
  344. .. warning::
  345. In addition to the changes outlined in this section, be sure to review the
  346. :ref:`removed-features-1.10` for the features that have reached the end of
  347. their deprecation cycle and therefore been removed. If you haven't updated
  348. your code within the deprecation timeline for a given feature, its removal
  349. may appear as a backwards incompatible change.
  350. Database backend API
  351. --------------------
  352. * GIS's ``AreaField`` uses an unspecified underlying numeric type that could in
  353. practice be any numeric Python type. ``decimal.Decimal`` values retrieved
  354. from the database are now converted to ``float`` to make it easier to combine
  355. them with values used by the GIS libraries.
  356. * In order to enable temporal subtraction you must set the
  357. ``supports_temporal_subtraction`` database feature flag to ``True`` and
  358. implement the ``DatabaseOperations.subtract_temporals()`` method. This
  359. method should return the SQL and parameters required to compute the
  360. difference in microseconds between the ``lhs`` and ``rhs`` arguments in the
  361. datatype used to store :class:`~django.db.models.DurationField`.
  362. ``select_related()`` prohibits non-relational fields for nested relations
  363. -------------------------------------------------------------------------
  364. Django 1.8 added validation for non-relational fields in ``select_related()``::
  365. >>> Book.objects.select_related('title')
  366. Traceback (most recent call last):
  367. ...
  368. FieldError: Non-relational field given in select_related: 'title'
  369. But it didn't prohibit nested non-relation fields as it does now::
  370. >>> Book.objects.select_related('author__name')
  371. Traceback (most recent call last):
  372. ...
  373. FieldError: Non-relational field given in select_related: 'name'
  374. ``_meta.get_fields()`` returns consistent reverse fields for proxy models
  375. -------------------------------------------------------------------------
  376. Before Django 1.10, the :meth:`~django.db.models.options.Options.get_fields`
  377. method returned different reverse fields when called on a proxy model compared
  378. to its proxied concrete class. This inconsistency was fixed by returning the
  379. full set of fields pointing to a concrete class or one of its proxies in both
  380. cases.
  381. :attr:`AbstractUser.username <django.contrib.auth.models.User.username>` ``max_length`` increased to 150
  382. --------------------------------------------------------------------------------------------------------
  383. A migration for :attr:`django.contrib.auth.models.User.username` is included.
  384. If you have a custom user model inheriting from ``AbstractUser``, you'll need
  385. to generate and apply a database migration for your user model.
  386. We considered an increase to 254 characters to more easily allow the use of
  387. email addresses (which are limited to 254 characters) as usernames but rejected
  388. it due to a MySQL limitation. When using the ``utf8mb4`` encoding (recommended
  389. for proper Unicode support), MySQL can only create unique indexes with 191
  390. characters by default. Therefore, if you need a longer length, please use a
  391. custom user model.
  392. If you want to preserve the 30 character limit for usernames, use a custom form
  393. when creating a user or changing usernames::
  394. from django.contrib.auth.forms import UserCreationForm
  395. class MyUserCreationForm(UserCreationForm):
  396. username = forms.CharField(
  397. max_length=30,
  398. help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
  399. )
  400. If you wish to keep this restriction in the admin, set ``UserAdmin.add_form``
  401. to use this form::
  402. from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
  403. from django.contrib.auth.models import User
  404. class UserAdmin(BaseUserAdmin):
  405. add_form = MyUserCreationForm
  406. admin.site.unregister(User)
  407. admin.site.register(User, UserAdmin)
  408. Dropped support for PostgreSQL 9.1
  409. ----------------------------------
  410. Upstream support for PostgreSQL 9.1 ends in September 2016. As a consequence,
  411. Django 1.10 sets PostgreSQL 9.2 as the minimum version it officially supports.
  412. ``runserver`` output goes through logging
  413. -----------------------------------------
  414. Request and response handling of the ``runserver`` command is sent to the
  415. :ref:`django-server-logger` logger instead of to ``sys.stderr``. If you
  416. disable Django's logging configuration or override it with your own, you'll
  417. need to add the appropriate logging configuration if you want to see that
  418. output::
  419. 'formatters': {
  420. 'django.server': {
  421. '()': 'django.utils.log.ServerFormatter',
  422. 'format': '[%(server_time)s] %(message)s',
  423. }
  424. },
  425. 'handlers': {
  426. 'django.server': {
  427. 'level': 'INFO',
  428. 'class': 'logging.StreamHandler',
  429. 'formatter': 'django.server',
  430. },
  431. },
  432. 'loggers': {
  433. 'django.server': {
  434. 'handlers': ['django.server'],
  435. 'level': 'INFO',
  436. 'propagate': False,
  437. }
  438. }
  439. ``auth.CustomUser`` and ``auth.ExtensionUser`` test models were removed
  440. -----------------------------------------------------------------------
  441. Since the introduction of migrations for the contrib apps in Django 1.8, the
  442. tables of these custom user test models were not created anymore making them
  443. unusable in a testing context.
  444. Apps registry is no longer auto-populated when unpickling models outside of Django
  445. ----------------------------------------------------------------------------------
  446. The apps registry is no longer auto-populated when unpickling models. This was
  447. added in Django 1.7.2 as an attempt to allow unpickling models outside of
  448. Django, such as in an RQ worker, without calling ``django.setup()``, but it
  449. creates the possibility of a deadlock. To adapt your code in the case of RQ,
  450. you can `provide your own worker script <http://python-rq.org/docs/workers/>`_
  451. that calls ``django.setup()``.
  452. Removed null assignment check for non-null foreign key fields
  453. -------------------------------------------------------------
  454. In older versions, assigning ``None`` to a non-nullable ``ForeignKey`` or
  455. ``OneToOneField`` raised ``ValueError('Cannot assign None: "model.field" does
  456. not allow null values.')``. For consistency with other model fields which don't
  457. have a similar check, this check is removed.
  458. Removed weak password hashers from the default ``PASSWORD_HASHERS`` setting
  459. ---------------------------------------------------------------------------
  460. Django 0.90 stored passwords as unsalted MD5. Django 0.91 added support for
  461. salted SHA1 with automatic upgrade of passwords when a user logs in. Django 1.4
  462. added PBKDF2 as the default password hasher.
  463. If you have an old Django project with MD5 or SHA1 (even salted) encoded
  464. passwords, be aware that these can be cracked fairly easily with today's
  465. hardware. To make Django users acknowledge continued use of weak hashers, the
  466. following hashers are removed from the default :setting:`PASSWORD_HASHERS`
  467. setting::
  468. 'django.contrib.auth.hashers.SHA1PasswordHasher'
  469. 'django.contrib.auth.hashers.MD5PasswordHasher'
  470. 'django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher'
  471. 'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher'
  472. 'django.contrib.auth.hashers.CryptPasswordHasher'
  473. Consider using a :ref:`wrapped password hasher <wrapping-password-hashers>` to
  474. strengthen the hashes in your database. If that's not feasible, add the
  475. :setting:`PASSWORD_HASHERS` setting to your project and add back any hashers
  476. that you need.
  477. You can check if your database has any of the removed hashers like this::
  478. from django.contrib.auth import get_user_model
  479. User = get_user_model()
  480. # Unsalted MD5/SHA1:
  481. User.objects.filter(password__startswith='md5$$')
  482. User.objects.filter(password__startswith='sha1$$')
  483. # Salted MD5/SHA1:
  484. User.objects.filter(password__startswith='md5$').exclude(password__startswith='md5$$')
  485. User.objects.filter(password__startswith='sha1$').exclude(password__startswith='sha1$$')
  486. # Crypt hasher:
  487. User.objects.filter(password__startswith='crypt$$')
  488. from django.db.models import CharField
  489. from django.db.models.functions import Length
  490. CharField.register_lookup(Length)
  491. # Unsalted MD5 passwords might not have an 'md5$$' prefix:
  492. User.objects.filter(password__length=32)
  493. :mod:`django.contrib.gis`
  494. -------------------------
  495. * Support for SpatiaLite < 3.0 and GEOS < 3.3 is dropped.
  496. * The ``add_postgis_srs()`` backwards compatibility alias for
  497. ``django.contrib.gis.utils.add_srs_entry()`` is removed.
  498. * On Oracle/GIS, the :class:`~django.contrib.gis.db.models.functions.Area`
  499. aggregate function now returns a ``float`` instead of ``decimal.Decimal``.
  500. (It's still wrapped in a measure of square meters.)
  501. * The default :class:`~django.contrib.gis.geos.GEOSGeometry` representation (WKT
  502. output) is trimmed by default. That is, instead of
  503. ``POINT (23.0000000000000000 5.5000000000000000)``, you'll get
  504. ``POINT (23 5.5)``.
  505. Miscellaneous
  506. -------------
  507. * The ``repr()`` of a ``QuerySet`` is wrapped in ``<QuerySet >`` to
  508. disambiguate it from a plain list when debugging.
  509. * ``utils.version.get_version()`` returns :pep:`440` compliant release
  510. candidate versions (e.g. '1.10rc1' instead of '1.10c1').
  511. * The ``LOGOUT_URL`` setting is removed as Django hasn't made use of it
  512. since pre-1.0. If you use it in your project, you can add it to your
  513. project's settings. The default value was ``'/accounts/logout/'``.
  514. * Objects with a ``close()`` method such as files and generators passed to
  515. :class:`~django.http.HttpResponse` are now closed immediately instead of when
  516. the WSGI server calls ``close()`` on the response.
  517. * A redundant ``transaction.atomic()`` call in ``QuerySet.update_or_create()``
  518. is removed. This may affect query counts tested by
  519. ``TransactionTestCase.assertNumQueries()``.
  520. * Support for ``skip_validation`` in ``BaseCommand.execute(**options)`` is
  521. removed. Use ``skip_checks`` (added in Django 1.7) instead.
  522. * :djadmin:`loaddata` now raises a ``CommandError`` instead of showing a
  523. warning when the specified fixture file is not found.
  524. * Instead of directly accessing the ``LogEntry.change_message`` attribute, it's
  525. now better to call the ``LogEntry.get_change_message()`` method which will
  526. provide the message in the current language.
  527. * The default error views now raise ``TemplateDoesNotExist`` if a nonexistent
  528. ``template_name`` is specified.
  529. * The unused ``choices`` keyword argument of the ``Select`` and
  530. ``SelectMultiple`` widgets' ``render()`` method is removed. The ``choices``
  531. argument of the ``render_options()`` method is also removed, making
  532. ``selected_choices`` the first argument.
  533. * Tests that violate deferrable database constraints will now error when run on
  534. a database that supports deferrable constraints.
  535. * Built-in management commands now use indexing of keys in ``options``, e.g.
  536. ``options['verbosity']``, instead of ``options.get()`` and no longer perform
  537. any type coercion. This could be a problem if you're calling commands using
  538. ``Command.execute()`` (which bypasses the argument parser that sets a default
  539. value) instead of :func:`~django.core.management.call_command`. Instead of
  540. calling ``Command.execute()``, pass the command object as the first argument
  541. to ``call_command()``.
  542. * :class:`~django.contrib.auth.backends.ModelBackend` and
  543. :class:`~django.contrib.auth.backends.RemoteUserBackend` now reject inactive
  544. users. This means that inactive users can't login and will be logged
  545. out if they are switched from ``is_active=True`` to ``False``. If you need
  546. the previous behavior, use the new
  547. :class:`~django.contrib.auth.backends.AllowAllUsersModelBackend` or
  548. :class:`~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend`
  549. in :setting:`AUTHENTICATION_BACKENDS` instead.
  550. * In light of the previous change, the test client's
  551. :meth:`~django.test.Client.login()` method no longer always rejects inactive
  552. users but instead delegates this decision to the authentication backend.
  553. * :func:`django.views.i18n.set_language` may now return a 204 status code for
  554. AJAX requests.
  555. * The ``base_field`` attribute of
  556. :class:`~django.contrib.postgres.fields.RangeField` is now a type of field,
  557. not an instance of a field. If you have created a custom subclass of
  558. :class:`~django.contrib.postgres.fields.RangeField`, you should change the
  559. ``base_field`` attribute.
  560. * Middleware classes are now initialized when the server starts rather than
  561. during the first request.
  562. * If you override ``is_authenticated()`` or ``is_anonymous()`` in a custom user
  563. model, you must convert them to attributes or properties as described in
  564. :ref:`the deprecation note <user-is-auth-anon-deprecation>`.
  565. * When using :attr:`ModelAdmin.save_as=True
  566. <django.contrib.admin.ModelAdmin.save_as>`, the "Save as new" button now
  567. redirects to the change view for the new object instead of to the model's
  568. changelist. If you need the previous behavior, set the new
  569. :attr:`ModelAdmin.save_as_continue
  570. <django.contrib.admin.ModelAdmin.save_as_continue>` attribute to ``False``.
  571. * Required form fields now have the ``required`` HTML attribute. Set the
  572. :attr:`Form.use_required_attribute <django.forms.Form.use_required_attribute>`
  573. attribute to ``False`` to disable it. You could also add the ``novalidate``
  574. attribute to ``<form>`` if you don't want browser validation.
  575. .. _deprecated-features-1.10:
  576. Features deprecated in 1.10
  577. ===========================
  578. Direct assignment to a reverse foreign key or many-to-many relation
  579. -------------------------------------------------------------------
  580. Instead of assigning related objects using direct assignment::
  581. >>> new_list = [obj1, obj2, obj3]
  582. >>> e.related_set = new_list
  583. Use the :meth:`~django.db.models.fields.related.RelatedManager.set` method
  584. added in Django 1.9::
  585. >>> e.related_set.set([obj1, obj2, obj3])
  586. This prevents confusion about an assignment resulting in an implicit save.
  587. Non-timezone-aware :class:`~django.core.files.storage.Storage` API
  588. ------------------------------------------------------------------
  589. The old, non-timezone-aware methods ``accessed_time()``, ``created_time()``,
  590. and ``modified_time()`` are deprecated in favor of the new ``get_*_time()``
  591. methods.
  592. Third-party storage backends should implement the new methods and mark the old
  593. ones as deprecated. Until then, the new ``get_*_time()`` methods on the base
  594. :class:`~django.core.files.storage.Storage` class convert ``datetime``\s from
  595. the old methods as required and emit a deprecation warning as they do so.
  596. Third-party storage backends may retain the old methods as long as they
  597. wish to support earlier versions of Django.
  598. :mod:`django.contrib.gis`
  599. -------------------------
  600. * The ``get_srid()`` and ``set_srid()`` methods of
  601. :class:`~django.contrib.gis.geos.GEOSGeometry` are deprecated in favor
  602. of the :attr:`~django.contrib.gis.geos.GEOSGeometry.srid` property.
  603. * The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and
  604. ``set_z()`` methods of :class:`~django.contrib.gis.geos.Point` are deprecated
  605. in favor of the ``x``, ``y``, and ``z`` properties.
  606. * The ``get_coords()`` and ``set_coords()`` methods of
  607. :class:`~django.contrib.gis.geos.Point` are deprecated in favor of the
  608. ``tuple`` property.
  609. * The ``cascaded_union`` property of
  610. :class:`~django.contrib.gis.geos.MultiPolygon` is deprecated in favor of the
  611. :attr:`~django.contrib.gis.geos.GEOSGeometry.unary_union` property.
  612. * The ``django.contrib.gis.utils.precision_wkt()`` function is deprecated in
  613. favor of :class:`~django.contrib.gis.geos.WKTWriter`.
  614. ``CommaSeparatedIntegerField`` model field
  615. ------------------------------------------
  616. ``CommaSeparatedIntegerField`` is deprecated in favor of
  617. :class:`~django.db.models.CharField` with the
  618. :func:`~django.core.validators.validate_comma_separated_integer_list`
  619. validator::
  620. from django.core.validators import validate_comma_separated_integer_list
  621. from django.db import models
  622. class MyModel(models.Model):
  623. numbers = models.CharField(..., validators=[validate_comma_separated_integer_list])
  624. If you're using Oracle, ``CharField`` uses a different database field type
  625. (``NVARCHAR2``) than ``CommaSeparatedIntegerField`` (``VARCHAR2``). Depending
  626. on your database settings, this might imply a different encoding, and thus a
  627. different length (in bytes) for the same contents. If your stored values are
  628. longer than the 4000 byte limit of ``NVARCHAR2``, you should use ``TextField``
  629. (``NCLOB``) instead. In this case, if you have any queries that group by the
  630. field (e.g. annotating the model with an aggregation or using ``distinct()``)
  631. you'll need to change them (to defer the field).
  632. Using a model name as a query lookup when ``default_related_name`` is set
  633. -------------------------------------------------------------------------
  634. Assume the following models::
  635. from django.db import models
  636. class Foo(models.Model):
  637. pass
  638. class Bar(models.Model):
  639. foo = models.ForeignKey(Foo)
  640. class Meta:
  641. default_related_name = 'bars'
  642. In older versions, :attr:`~django.db.models.Options.default_related_name`
  643. couldn't be used as a query lookup. This is fixed and support for the old
  644. lookup name is deprecated. For example, since ``default_related_name`` is set
  645. in model ``Bar``, instead of using the model name ``bar`` as the lookup::
  646. >>> bar = Bar.objects.get(pk=1)
  647. >>> Foo.objects.get(bar=bar)
  648. use the default_related_name ``bars``::
  649. >>> Foo.objects.get(bars=bar)
  650. .. _search-lookup-replacement:
  651. ``__search`` query lookup
  652. -------------------------
  653. The ``search`` lookup, which supports MySQL only and is extremely limited in
  654. features, is deprecated. Replace it with a custom lookup::
  655. from django.db import models
  656. class Search(models.Lookup):
  657. lookup_name = 'search'
  658. def as_mysql(self, compiler, connection):
  659. lhs, lhs_params = self.process_lhs(compiler, connection)
  660. rhs, rhs_params = self.process_rhs(compiler, connection)
  661. params = lhs_params + rhs_params
  662. return 'MATCH (%s) AGAINST (%s IN BOOLEAN MODE)' % (lhs, rhs), params
  663. models.CharField.register_lookup(Search)
  664. models.TextField.register_lookup(Search)
  665. .. _user-is-auth-anon-deprecation:
  666. Using ``User.is_authenticated()`` and ``User.is_anonymous()`` as methods
  667. ------------------------------------------------------------------------
  668. The ``is_authenticated()`` and ``is_anonymous()`` methods of
  669. :class:`~django.contrib.auth.models.AbstractBaseUser` and
  670. :class:`~django.contrib.auth.models.AnonymousUser` classes are now
  671. properties. They will still work as methods until Django 2.0, but all usage
  672. in Django now uses attribute access.
  673. For example, if you use
  674. :class:`~django.contrib.auth.middleware.AuthenticationMiddleware` and want
  675. to know whether the user is currently logged-in you would use::
  676. if request.user.is_authenticated:
  677. ... # Do something for logged-in users.
  678. else:
  679. ... # Do something for anonymous users.
  680. instead of ``request.user.is_authenticated()``.
  681. This change avoids accidental information leakage if you forget to call the
  682. method, e.g.::
  683. if request.user.is_authenticated:
  684. return sensitive_information
  685. If you override these methods in a custom user model, you must change them to
  686. properties or attributes.
  687. Custom manager classes available through ``prefetch_related`` must define a ``_apply_rel_filters()`` method
  688. -----------------------------------------------------------------------------------------------------------
  689. If you defined a custom manager class available through
  690. :meth:`~django.db.models.query.QuerySet.prefetch_related` you must make sure
  691. it defines a ``_apply_rel_filters()`` method.
  692. This method must accept a :class:`~django.db.models.query.QuerySet` instance
  693. as its single argument and return a filtered version of the queryset for the
  694. model instance the manager is bound to.
  695. Miscellaneous
  696. -------------
  697. * The ``makemigrations --exit`` option is deprecated in favor of the
  698. :option:`makemigrations --check` option.
  699. * ``django.utils.functional.allow_lazy()`` is deprecated in favor of the new
  700. :func:`~django.utils.functional.keep_lazy` function which can be used with a
  701. more natural decorator syntax.
  702. * The ``shell --plain`` option is deprecated in favor of ``-i python`` or
  703. ``--interface python``.
  704. * Importing from the ``django.core.urlresolvers`` module is deprecated in
  705. favor of its new location, :mod:`django.urls`.
  706. * The template ``Context.has_key()`` method is deprecated in favor of ``in``.
  707. * The private attribute ``virtual_fields`` of ``Model._meta`` is
  708. deprecated in favor of ``private_fields``.
  709. * The private keyword arguments ``virtual_only`` in
  710. ``Field.contribute_to_class()`` and ``virtual`` in
  711. ``Model._meta.add_field()`` are deprecated in favor of ``private_only``
  712. and ``private``, respectively.
  713. * The ``javascript_catalog()`` and ``json_catalog()`` views are deprecated in
  714. favor of class-based views :class:`~django.views.i18n.JavaScriptCatalog`
  715. and :class:`~django.views.i18n.JSONCatalog`.
  716. .. _removed-features-1.10:
  717. Features removed in 1.10
  718. ========================
  719. These features have reached the end of their deprecation cycle and so have been
  720. removed in Django 1.10 (please see the :ref:`deprecation timeline
  721. <deprecation-removed-in-1.10>` for more details):
  722. * Support for calling a ``SQLCompiler`` directly as an alias for calling its
  723. ``quote_name_unless_alias`` method is removed.
  724. * The ``cycle`` and ``firstof`` template tags are removed from the ``future``
  725. template tag library.
  726. * ``django.conf.urls.patterns()`` is removed.
  727. * Support for the ``prefix`` argument to
  728. ``django.conf.urls.i18n.i18n_patterns()`` is removed.
  729. * ``SimpleTestCase.urls`` is removed.
  730. * Using an incorrect count of unpacked values in the ``for`` template tag
  731. raises an exception rather than failing silently.
  732. * The ability to :func:`~django.urls.reverse` URLs using a dotted Python path
  733. is removed.
  734. * The ability to use a dotted Python path for the ``LOGIN_URL`` and
  735. ``LOGIN_REDIRECT_URL`` settings is removed.
  736. * Support for ``optparse`` is dropped for custom management commands.
  737. * The class ``django.core.management.NoArgsCommand`` is removed.
  738. * ``django.core.context_processors`` module is removed.
  739. * ``django.db.models.sql.aggregates`` module is removed.
  740. * ``django.contrib.gis.db.models.sql.aggregates`` module is removed.
  741. * The following methods and properties of ``django.db.sql.query.Query`` are
  742. removed:
  743. * Properties: ``aggregates`` and ``aggregate_select``
  744. * Methods: ``add_aggregate``, ``set_aggregate_mask``, and
  745. ``append_aggregate_mask``.
  746. * ``django.template.resolve_variable`` is removed.
  747. * The following private APIs are removed from
  748. :class:`django.db.models.options.Options` (``Model._meta``):
  749. * ``get_field_by_name()``
  750. * ``get_all_field_names()``
  751. * ``get_fields_with_model()``
  752. * ``get_concrete_fields_with_model()``
  753. * ``get_m2m_with_model()``
  754. * ``get_all_related_objects()``
  755. * ``get_all_related_objects_with_model()``
  756. * ``get_all_related_many_to_many_objects()``
  757. * ``get_all_related_m2m_objects_with_model()``
  758. * The ``error_message`` argument of ``django.forms.RegexField`` is removed.
  759. * The ``unordered_list`` filter no longer supports old style lists.
  760. * Support for string ``view`` arguments to ``url()`` is removed.
  761. * The backward compatible shim to rename ``django.forms.Form._has_changed()``
  762. to ``has_changed()`` is removed.
  763. * The ``removetags`` template filter is removed.
  764. * The ``remove_tags()`` and ``strip_entities()`` functions in
  765. ``django.utils.html`` is removed.
  766. * The ``is_admin_site`` argument to
  767. ``django.contrib.auth.views.password_reset()`` is removed.
  768. * ``django.db.models.field.subclassing.SubfieldBase`` is removed.
  769. * ``django.utils.checksums`` is removed.
  770. * The ``original_content_type_id`` attribute on
  771. ``django.contrib.admin.helpers.InlineAdminForm`` is removed.
  772. * The backwards compatibility shim to allow ``FormMixin.get_form()`` to be
  773. defined with no default value for its ``form_class`` argument is removed.
  774. * The following settings are removed:
  775. * ``ALLOWED_INCLUDE_ROOTS``
  776. * ``TEMPLATE_CONTEXT_PROCESSORS``
  777. * ``TEMPLATE_DEBUG``
  778. * ``TEMPLATE_DIRS``
  779. * ``TEMPLATE_LOADERS``
  780. * ``TEMPLATE_STRING_IF_INVALID``
  781. * The backwards compatibility alias ``django.template.loader.BaseLoader`` is
  782. removed.
  783. * Django template objects returned by
  784. :func:`~django.template.loader.get_template` and
  785. :func:`~django.template.loader.select_template` no longer accept a
  786. :class:`~django.template.Context` in their
  787. :meth:`~django.template.backends.base.Template.render()` method.
  788. * :doc:`Template response APIs </ref/template-response>` enforce the use of
  789. :class:`dict` and backend-dependent template objects instead of
  790. :class:`~django.template.Context` and :class:`~django.template.Template`
  791. respectively.
  792. * The ``current_app`` parameter for the following function and classes is
  793. removed:
  794. * ``django.shortcuts.render()``
  795. * ``django.template.Context()``
  796. * ``django.template.RequestContext()``
  797. * ``django.template.response.TemplateResponse()``
  798. * The ``dictionary`` and ``context_instance`` parameters for the following
  799. functions are removed:
  800. * ``django.shortcuts.render()``
  801. * ``django.shortcuts.render_to_response()``
  802. * ``django.template.loader.render_to_string()``
  803. * The ``dirs`` parameter for the following functions is removed:
  804. * ``django.template.loader.get_template()``
  805. * ``django.template.loader.select_template()``
  806. * ``django.shortcuts.render()``
  807. * ``django.shortcuts.render_to_response()``
  808. * Session verification is enabled regardless of whether or not
  809. ``'django.contrib.auth.middleware.SessionAuthenticationMiddleware'`` is in
  810. ``MIDDLEWARE_CLASSES``. ``SessionAuthenticationMiddleware`` no longer has
  811. any purpose and can be removed from ``MIDDLEWARE_CLASSES``. It's kept as
  812. a stub until Django 2.0 as a courtesy for users who don't read this note.
  813. * Private attribute ``django.db.models.Field.related`` is removed.
  814. * The ``--list`` option of the ``migrate`` management command is removed.
  815. * The ``ssi`` template tag is removed.
  816. * Support for the ``=`` comparison operator in the ``if`` template tag is
  817. removed.
  818. * The backwards compatibility shims to allow ``Storage.get_available_name()``
  819. and ``Storage.save()`` to be defined without a ``max_length`` argument are
  820. removed.
  821. * Support for the legacy ``%(<foo>)s`` syntax in ``ModelFormMixin.success_url``
  822. is removed.
  823. * ``GeoQuerySet`` aggregate methods ``collect()``, ``extent()``, ``extent3d()``,
  824. ``make_line()``, and ``unionagg()`` are removed.
  825. * The ability to specify ``ContentType.name`` when creating a content type
  826. instance is removed.
  827. * Support for the old signature of ``allow_migrate`` is removed.
  828. * Support for the syntax of ``{% cycle %}`` that uses comma-separated arguments
  829. is removed.
  830. * The warning that :class:`~django.core.signing.Signer` issued when given an
  831. invalid separator is now a ``ValueError``.