1.7.txt 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. ============================================
  2. Django 1.7 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. Welcome to Django 1.7!
  5. These release notes cover the `new features`_, as well as some `backwards
  6. incompatible changes`_ you'll want to be aware of when upgrading from Django
  7. 1.6 or older versions. We've also dropped some features, which are detailed in
  8. :doc:`our deprecation plan </internals/deprecation>`, and we've `begun the
  9. deprecation process for some features`_.
  10. .. _`new features`: `What's new in Django 1.7`_
  11. .. _`backwards incompatible changes`: `Backwards incompatible changes in 1.7`_
  12. .. _`begun the deprecation process for some features`: `Features deprecated in 1.7`_
  13. Python compatibility
  14. ====================
  15. Django 1.7 requires Python 2.7 or above, though we **highly recommend**
  16. the latest minor release. Support for Python 2.6 has been dropped.
  17. This change should affect only a small number of Django users, as most
  18. operating-system vendors today are shipping Python 2.7 or newer as their default
  19. version. If you're still using Python 2.6, however, you'll need to stick to
  20. Django 1.6 until you can upgrade your Python version. Per :doc:`our support
  21. policy </internals/release-process>`, Django 1.6 will continue to receive
  22. security support until the release of Django 1.8.
  23. What's new in Django 1.7
  24. ========================
  25. Schema migrations
  26. ~~~~~~~~~~~~~~~~~
  27. Django now has built-in support for schema migrations. It allows models
  28. to be updated, changed, and deleted by creating migration files that represent
  29. the model changes and which can be run on any development, staging or production
  30. database.
  31. Migrations are covered in :doc:`their own documentation</topics/migrations>`,
  32. but a few of the key features are:
  33. * ``syncdb`` has been deprecated and replaced by ``migrate``. Don't worry -
  34. calls to ``syncdb`` will still work as before.
  35. * A new ``makemigrations`` command provides an easy way to autodetect changes
  36. to your models and make migrations for them.
  37. :data:`~django.db.models.signals.pre_syncdb` and
  38. :data:`~django.db.models.signals.post_syncdb` have been replaced by
  39. :data:`~django.db.models.signals.pre_migrate` and
  40. :data:`~django.db.models.signals.post_migrate` respectively. These new
  41. signals have slightly different arguments. Check the documentation for
  42. details.
  43. * The ``allow_syncdb`` method on database routers is now called ``allow_migrate``,
  44. but still performs the same function. Routers with ``allow_syncdb`` methods
  45. will still work, but that method name is deprecated and you should change
  46. it as soon as possible (nothing more than renaming is required).
  47. App-loading refactor
  48. ~~~~~~~~~~~~~~~~~~~~
  49. Historically, Django applications were tightly linked to models. A singleton
  50. known as the "app cache" dealt with both installed applications and models.
  51. The models module was used as an identifier for applications in many APIs.
  52. As the concept of :doc:`Django applications </ref/applications>` matured, this
  53. code showed some shortcomings. It has been refactored into an "app registry"
  54. where models modules no longer have a central role and where it's possible to
  55. attach configuration data to applications.
  56. Improvements thus far include:
  57. * Applications can run code at startup, before Django does anything else, with
  58. the :meth:`~django.apps.AppConfig.ready` method of their configuration.
  59. * It is possible to omit ``models.py`` entirely if an application doesn't
  60. have any models.
  61. * Applications can be relabeled with the :attr:`~django.apps.AppConfig.label`
  62. attribute of application configurations, to work around label conflicts.
  63. * The name of applications can be customized in the admin with the
  64. :attr:`~django.apps.AppConfig.verbose_name` of application configurations.
  65. * Django imports all application configurations and models as soon as it
  66. starts, through a deterministic and straightforward process. This should
  67. make it easier to diagnose import issues such as import loops.
  68. New method on Field subclasses
  69. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. To help power both schema migrations and composite keys, the :class:`~django.db.models.Field` API now
  71. has a new required method: ``deconstruct()``.
  72. This method takes no arguments, and returns a tuple of four items:
  73. * ``name``: The field's attribute name on its parent model, or None if it is not part of a model
  74. * ``path``: A dotted, Python path to the class of this field, including the class name.
  75. * ``args``: Positional arguments, as a list
  76. * ``kwargs``: Keyword arguments, as a dict
  77. These four values allow any field to be serialized into a file, as well as
  78. allowing the field to be copied safely, both essential parts of these new features.
  79. This change should not affect you unless you write custom Field subclasses;
  80. if you do, you may need to reimplement the ``deconstruct()`` method if your
  81. subclass changes the method signature of ``__init__`` in any way. If your
  82. field just inherits from a built-in Django field and doesn't override ``__init__``,
  83. no changes are necessary.
  84. If you do need to override ``deconstruct()``, a good place to start is the
  85. built-in Django fields (``django/db/models/fields/__init__.py``) as several
  86. fields, including ``DecimalField`` and ``DateField``, override it and show how
  87. to call the method on the superclass and simply add or remove extra arguments.
  88. Calling custom ``QuerySet`` methods from the ``Manager``
  89. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. The :meth:`QuerySet.as_manager() <django.db.models.query.QuerySet.as_manager>`
  91. class method has been added to :ref:`create Manager with QuerySet methods
  92. <create-manager-with-queryset-methods>`.
  93. Using a custom manager when traversing reverse relations
  94. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95. It is now possible to :ref:`specify a custom manager
  96. <using-custom-reverse-manager>` when traversing a reverse relationship.
  97. New ``Prefetch`` object for advanced ``prefetch_related`` operations.
  98. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99. The new :class:`~django.db.models.Prefetch` object allows customizing
  100. prefetch operations.
  101. You can specify the ``QuerySet`` used to traverse a given relation
  102. or customize the storage location of prefetch results.
  103. This enables things like filtering prefetched relations, calling
  104. :meth:`~django.db.models.query.QuerySet.select_related()` from a prefetched
  105. relation, or prefetching the same relation multiple times with different
  106. querysets. See :meth:`~django.db.models.query.QuerySet.prefetch_related()`
  107. for more details.
  108. Admin shortcuts support time zones
  109. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. The "today" and "now" shortcuts next to date and time input widgets in the
  111. admin are now operating in the :ref:`current time zone
  112. <default-current-time-zone>`. Previously, they used the browser time zone,
  113. which could result in saving the wrong value when it didn't match the current
  114. time zone on the server.
  115. In addition, the widgets now display a help message when the browser and
  116. server time zone are different, to clarify how the value inserted in the field
  117. will be interpreted.
  118. Using database cursors as context managers
  119. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  120. Prior to Python 2.7, database cursors could be used as a context manager. The
  121. specific backend's cursor defined the behavior of the context manager. The
  122. behavior of magic method lookups was changed with Python 2.7 and cursors were
  123. no longer usable as context managers.
  124. Django 1.7 allows a cursor to be used as a context manager that is a shortcut
  125. for the following, instead of backend specific behavior.
  126. .. code-block:: python
  127. c = connection.cursor()
  128. try:
  129. c.execute(...)
  130. finally:
  131. c.close()
  132. Minor features
  133. ~~~~~~~~~~~~~~
  134. :mod:`django.contrib.admin`
  135. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  136. * You can now implement :attr:`~django.contrib.admin.AdminSite.site_header`,
  137. :attr:`~django.contrib.admin.AdminSite.site_title`, and
  138. :attr:`~django.contrib.admin.AdminSite.index_title` attributes on a custom
  139. :class:`~django.contrib.admin.AdminSite` in order to easily change the admin
  140. site's page title and header text. No more needing to override templates!
  141. * Buttons in :mod:`django.contrib.admin` now use the ``border-radius`` CSS
  142. property for rounded corners rather than GIF background images.
  143. * Some admin templates now have ``app-<app_name>`` and ``model-<model_name>``
  144. classes in their ``<body>`` tag to allow customizing the CSS per app or per
  145. model.
  146. * The admin changelist cells now have a ``field-<field_name>`` class in the
  147. HTML to enable style customizations.
  148. * The admin's search fields can now be customized per-request thanks to the new
  149. :meth:`django.contrib.admin.ModelAdmin.get_search_fields` method.
  150. * The :meth:`ModelAdmin.get_fields()
  151. <django.contrib.admin.ModelAdmin.get_fields>` method may be overridden to
  152. customize the value of :attr:`ModelAdmin.fields
  153. <django.contrib.admin.ModelAdmin.fields>`.
  154. * In addition to the existing ``admin.site.register`` syntax, you can use the
  155. new :func:`~django.contrib.admin.register` decorator to register a
  156. :class:`~django.contrib.admin.ModelAdmin`.
  157. * You may specify :meth:`ModelAdmin.list_display_links
  158. <django.contrib.admin.ModelAdmin.list_display_links>` ``= None`` to disable
  159. links on the change list page grid.
  160. * You may now specify :attr:`ModelAdmin.view_on_site
  161. <django.contrib.admin.ModelAdmin.view_on_site>` to control whether or not to
  162. display the "View on site" link.
  163. :mod:`django.contrib.auth`
  164. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  165. * Any ``**kwargs`` passed to
  166. :meth:`~django.contrib.auth.models.User.email_user()` are passed to the
  167. underlying :meth:`~django.core.mail.send_mail()` call.
  168. * The :func:`~django.contrib.auth.decorators.permission_required` decorator can
  169. take a list of permissions as well as a single permission.
  170. * You can override the new :meth:`AuthenticationForm.confirm_login_allowed()
  171. <django.contrib.auth.forms.AuthenticationForm.confirm_login_allowed>` method
  172. to more easily customize the login policy.
  173. * :func:`django.contrib.auth.views.password_reset` takes an optional
  174. ``html_email_template_name`` parameter used to send a multipart HTML email
  175. for password resets.
  176. :mod:`django.contrib.gis`
  177. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  178. * The default OpenLayers library version included in widgets has been updated
  179. from 2.11 to 2.13.
  180. * Prepared geometries now also support the ``crosses``, ``disjoint``,
  181. ``overlaps``, ``touches`` and ``within`` predicates, if GEOS 3.3 or later is
  182. installed.
  183. :mod:`django.contrib.messages`
  184. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  185. * The backends for :mod:`django.contrib.messages` that use cookies, will now
  186. follow the :setting:`SESSION_COOKIE_SECURE` and
  187. :setting:`SESSION_COOKIE_HTTPONLY` settings.
  188. * The :ref:`messages context processor <message-displaying>` now adds a
  189. dictionary of default levels under the name ``DEFAULT_MESSAGE_LEVELS``.
  190. * :class:`~django.contrib.messages.storage.base.Message` objects now have a
  191. ``level_tag`` attribute that contains the string representation of the
  192. message level.
  193. :mod:`django.contrib.redirects`
  194. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  195. * :class:`~django.contrib.redirects.middleware.RedirectFallbackMiddleware`
  196. has two new attributes
  197. (:attr:`~django.contrib.redirects.middleware.RedirectFallbackMiddleware.response_gone_class`
  198. and
  199. :attr:`~django.contrib.redirects.middleware.RedirectFallbackMiddleware.response_redirect_class`)
  200. that specify the types of :class:`~django.http.HttpResponse` instances the
  201. middleware returns.
  202. :mod:`django.contrib.sessions`
  203. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  204. * The ``"django.contrib.sessions.backends.cached_db"`` session backend now
  205. respects :setting:`SESSION_CACHE_ALIAS`. In previous versions, it always used
  206. the `default` cache.
  207. :mod:`django.contrib.sitemaps`
  208. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  209. * The :mod:`sitemap framework<django.contrib.sitemaps>` now makes use of
  210. :attr:`~django.contrib.sitemaps.Sitemap.lastmod` to set a ``Last-Modified``
  211. header in the response. This makes it possible for the
  212. :class:`~django.middleware.http.ConditionalGetMiddleware` to handle
  213. conditional ``GET`` requests for sitemaps which set ``lastmod``.
  214. :mod:`django.contrib.staticfiles`
  215. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  216. * The :ref:`static files storage classes <staticfiles-storages>` may be
  217. subclassed to override the permissions that collected static files and
  218. directories receive by setting the
  219. :attr:`~django.core.files.storage.FileSystemStorage.file_permissions_mode`
  220. and :attr:`~django.core.files.storage.FileSystemStorage.directory_permissions_mode`
  221. parameters. See :djadmin:`collectstatic` for example usage.
  222. :mod:`django.contrib.syndication`
  223. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  224. * The :class:`~django.utils.feedgenerator.Atom1Feed` syndication feed's
  225. ``updated`` element now utilizes ``updateddate`` instead of ``pubdate``,
  226. allowing the ``published`` element to be included in the feed (which
  227. relies on ``pubdate``).
  228. Cache
  229. ^^^^^
  230. * Access to caches configured in :setting:`CACHES` is now available via
  231. :data:`django.core.cache.caches`. This dict-like object provides a different
  232. instance per thread. It supersedes :func:`django.core.cache.get_cache` which
  233. is now deprecated.
  234. * If you instanciate cache backends directly, be aware that they aren't
  235. thread-safe any more, as :data:`django.core.cache.caches` now yields
  236. different instances per thread.
  237. Email
  238. ^^^^^
  239. * :func:`~django.core.mail.send_mail` now accepts an ``html_message``
  240. parameter for sending a multipart ``text/plain`` and ``text/html`` email.
  241. * The SMTP :class:`~django.core.mail.backends.smtp.EmailBackend` now accepts a
  242. :attr:`~django.core.mail.backends.smtp.EmailBackend.timeout` parameter.
  243. File Uploads
  244. ^^^^^^^^^^^^
  245. * The new :attr:`UploadedFile.content_type_extra
  246. <django.core.files.uploadedfile.UploadedFile.content_type_extra>` attribute
  247. contains extra parameters passed to the ``content-type`` header on a file
  248. upload.
  249. * The new :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS` setting controls
  250. the file system permissions of directories created during file upload, like
  251. :setting:`FILE_UPLOAD_PERMISSIONS` does for the files themselves.
  252. * The :attr:`FileField.upload_to <django.db.models.FileField.upload_to>`
  253. attribute is now optional. If it is omitted or given ``None`` or an empty
  254. string, a subdirectory won't be used for storing the uploaded files.
  255. Forms
  256. ^^^^^
  257. * The ``<label>`` and ``<input>`` tags rendered by
  258. :class:`~django.forms.RadioSelect` and
  259. :class:`~django.forms.CheckboxSelectMultiple` when looping over the radio
  260. buttons or checkboxes now include ``for`` and ``id`` attributes, respectively.
  261. Each radio button or checkbox includes an ``id_for_label`` attribute to
  262. output the element's ID.
  263. * :attr:`Field.choices<django.db.models.Field.choices>` now allows you to
  264. customize the "empty choice" label by including a tuple with an empty string
  265. or ``None`` for the key and the custom label as the value. The default blank
  266. option ``"----------"`` will be omitted in this case.
  267. * :class:`~django.forms.MultiValueField` allows optional subfields by setting
  268. the ``require_all_fields`` argument to ``False``. The ``required`` attribute
  269. for each individual field will be respected, and a new ``incomplete``
  270. validation error will be raised when any required fields are empty.
  271. * The :meth:`~django.forms.Form.clean` method on a form no longer needs to
  272. return ``self.cleaned_data``. If it does return a changed dictionary then
  273. that will still be used.
  274. * After a temporary regression in Django 1.6, it's now possible again to make
  275. :class:`~django.forms.TypedChoiceField` ``coerce`` method return an arbitrary
  276. value.
  277. * :attr:`SelectDateWidget.months
  278. <django.forms.extras.widgets.SelectDateWidget.months>` can be used to
  279. customize the wording of the months displayed in the select widget.
  280. * The ``min_num`` and ``validate_min`` parameters were added to
  281. :func:`~django.forms.formsets.formset_factory` to allow validating
  282. a minimum number of submitted forms.
  283. * The metaclasses used by ``Form`` and ``ModelForm`` have been reworked to
  284. support more inheritance scenarios. The previous limitation that prevented
  285. inheriting from both ``Form`` and ``ModelForm`` simultaneously have been
  286. removed as long as ``ModelForm`` appears first in the MRO.
  287. * It's now possible to opt-out from a ``Form`` field declared in a parent class
  288. by shadowing it with a non-``Field`` value.
  289. * The new :meth:`~django.forms.Form.add_error()` method allows adding errors
  290. to specific form fields.
  291. * The dict-like attribute :attr:`~django.forms.Form.errors` now has two new
  292. methods :meth:`~django.forms.Form.errors.as_data()` and
  293. :meth:`~django.forms.Form.errors.as_json()`. The former returns a ``dict``
  294. that maps fields to their original errors, complete with all metadata
  295. (error code and params), the latter returns the errors serialized as json.
  296. Internationalization
  297. ^^^^^^^^^^^^^^^^^^^^
  298. * The :attr:`django.middleware.locale.LocaleMiddleware.response_redirect_class`
  299. attribute allows you to customize the redirects issued by the middleware.
  300. * The :class:`~django.middleware.locale.LocaleMiddleware` now stores the user's
  301. selected language with the session key ``_language``. Previously it was
  302. stored with the key ``django_language``, but keys reserved for Django should
  303. start with an underscore. For backwards compatibility ``django_language`` is
  304. still read from in 1.7. Sessions will be migrated to the new ``_language``
  305. key as they are written.
  306. * The :ttag:`blocktrans` now supports a ``trimmed`` option. This
  307. option will remove newline characters from the beginning and the end of the
  308. content of the ``{% blocktrans %}`` tag, replace any whitespace at the
  309. beginning and end of a line and merge all lines into one using a space
  310. character to separate them. This is quite useful for indenting the content of
  311. a ``{% blocktrans %}`` tag without having the indentation characters end up
  312. in the corresponding entry in the PO file, which makes the translation
  313. process easier.
  314. * When you run :djadmin:`makemessages` from the root directory of your project,
  315. any extracted strings will now be automatically distributed to the proper
  316. app or project message file. See :ref:`how-to-create-language-files` for
  317. details.
  318. Management Commands
  319. ^^^^^^^^^^^^^^^^^^^
  320. * The :djadminopt:`--no-color` option for ``django-admin.py`` allows you to
  321. disable the colorization of management command output.
  322. * The new :djadminopt:`--natural-foreign` and :djadminopt:`--natural-primary`
  323. options for :djadmin:`dumpdata`, and the new ``use_natural_foreign_keys`` and
  324. ``use_natural_primary_keys`` arguments for ``serializers.serialize()``, allow
  325. the use of natural primary keys when serializing.
  326. * It is no longer necessary to provide the cache table name or the
  327. :djadminopt:`--database` option for the :djadmin:`createcachetable` command.
  328. Django takes this information from your settings file. If you have configured
  329. multiple caches or multiple databases, all cache tables are created.
  330. * The :djadmin:`runserver` command received several improvements:
  331. * On Linux systems, if pyinotify_ is installed, the development server will
  332. reload immediately when a file is changed. Previously, it polled the
  333. filesystem for changes every second. That caused a small delay before
  334. reloads and reduced battery life on laptops.
  335. .. _pyinotify: https://pypi.python.org/pypi/pyinotify
  336. * In addition, the development server automatically reloads when a
  337. translation file is updated, i.e. after running
  338. :djadmin:`compilemessages`.
  339. * All HTTP requests are logged to the console, including requests for static
  340. files or ``favicon.ico`` that used to be filtered out.
  341. * Management commands can now produce syntax colored output under Windows if
  342. the ANSICON third-party tool is installed and active.
  343. Models
  344. ^^^^^^
  345. * The :meth:`QuerySet.update_or_create()
  346. <django.db.models.query.QuerySet.update_or_create>` method was added.
  347. * The new :attr:`~django.db.models.Options.default_permissions` model
  348. ``Meta`` option allows you to customize (or disable) creation of the default
  349. add, change, and delete permissions.
  350. * :attr:`~django.db.models.Options.app_label` is no longer required for models
  351. that are defined in a ``models`` package within an app.
  352. * Explicit :class:`~django.db.models.OneToOneField` for
  353. :ref:`multi-table-inheritance` are now discovered in abstract classes.
  354. * Is it now possible to avoid creating a backward relation for
  355. :class:`~django.db.models.OneToOneField` by setting its
  356. :attr:`~django.db.models.ForeignKey.related_name` to
  357. ``'+'`` or ending it with ``'+'``.
  358. * :class:`F expressions <django.db.models.F>` support the power operator
  359. (``**``).
  360. * The ``remove()`` and ``clear()`` methods of the related managers created by
  361. ``ForeignKey`` and ``GenericForeignKey`` now accept the ``bulk`` keyword
  362. argument to control whether or not to perform operations in bulk
  363. (i.e. using ``QuerySet.update()``). Defaults to ``True``.
  364. * It is now possible to use ``None`` as a query value for the :lookup:`iexact`
  365. lookup.
  366. Signals
  367. ^^^^^^^
  368. * The ``enter`` argument was added to the
  369. :data:`~django.test.signals.setting_changed` signal.
  370. * The model signals can be now be connected to using a ``str`` of the
  371. ``'app_label.ModelName'`` form – just like related fields – to lazily
  372. reference their senders.
  373. Templates
  374. ^^^^^^^^^
  375. * The :meth:`Context.push() <django.template.Context.push>` method now returns
  376. a context manager which automatically calls :meth:`pop()
  377. <django.template.Context.pop>` upon exiting the ``with`` statement.
  378. Additionally, :meth:`push() <django.template.Context.push>` now accepts
  379. parameters that are passed to the ``dict`` constructor used to build the new
  380. context level.
  381. * The :ttag:`widthratio` template tag now accepts an "as" parameter to capture
  382. the result in a variable.
  383. * The :ttag:`include` template tag will now also accept anything with a
  384. ``render()`` method (such as a ``Template``) as an argument. String
  385. arguments will be looked up using
  386. :func:`~django.template.loader.get_template` as always.
  387. * It is now possible to :ttag:`include` templates recursively.
  388. * Template objects now have an origin attribute set when
  389. :setting:`TEMPLATE_DEBUG` is ``True``. This allows template origins to be
  390. inspected and logged outside of the ``django.template`` infrastructure.
  391. * ``TypeError`` exceptions are no longer silenced when raised during the
  392. rendering of a template.
  393. * The following functions now accept a ``dirs`` parameter which is a list or
  394. tuple to override :setting:`TEMPLATE_DIRS`:
  395. * :func:`django.template.loader.get_template()`
  396. * :func:`django.template.loader.select_template()`
  397. * :func:`django.shortcuts.render()`
  398. * :func:`django.shortcuts.render_to_response()`
  399. * The :tfilter:`time` filter now accepts timzone-related :ref:`format
  400. specifiers <date-and-time-formatting-specifiers>` ``'e'``, ``'O'`` , ``'T'``
  401. and ``'Z'`` and is able to digest :ref:`time-zone-aware
  402. <naive_vs_aware_datetimes>` ``datetime`` instances performing the expected
  403. rendering.
  404. * The :ttag:`cache` tag will now try to use the cache called
  405. "template_fragments" if it exists and fall back to using the default cache
  406. otherwise. It also now accepts an optional ``using`` keyword argument to
  407. control which cache it uses.
  408. Requests
  409. ^^^^^^^^
  410. * The new :attr:`HttpRequest.scheme <django.http.HttpRequest.scheme>` attribute
  411. specifies the scheme of the request (``http`` or ``https`` normally).
  412. Tests
  413. ^^^^^
  414. * :class:`~django.test.runner.DiscoverRunner` has two new attributes,
  415. :attr:`~django.test.runner.DiscoverRunner.test_suite` and
  416. :attr:`~django.test.runner.DiscoverRunner.test_runner`, which facilitate
  417. overriding the way tests are collected and run.
  418. * The ``fetch_redirect_response`` argument was added to
  419. :meth:`~django.test.SimpleTestCase.assertRedirects`. Since the test
  420. client can't fetch externals URLs, this allows you to use ``assertRedirects``
  421. with redirects that aren't part of your Django app.
  422. * Correct handling of scheme when making comparisons in
  423. :meth:`~django.test.SimpleTestCase.assertRedirects`.
  424. * The ``secure`` argument was added to all the request methods of
  425. :class:`~django.test.Client`. If ``True``, the request will be made
  426. through HTTPS.
  427. * Requests made with :meth:`Client.login() <django.test.Client.login>` and
  428. :meth:`Client.logout() <django.test.Client.logout>` respect defaults defined
  429. in :class:`~django.test.Client` instantiation and are processed through
  430. middleware.
  431. * :meth:`~django.test.TransactionTestCase.assertNumQueries` now prints
  432. out the list of executed queries if the assertion fails.
  433. Validators
  434. ^^^^^^^^^^
  435. * :class:`~django.core.validators.URLValidator` now accepts an optional
  436. ``schemes`` argument which allows customization of the accepted URI schemes
  437. (instead of the defaults ``http(s)`` and ``ftp(s)``).
  438. Backwards incompatible changes in 1.7
  439. =====================================
  440. .. warning::
  441. In addition to the changes outlined in this section, be sure to review the
  442. :doc:`deprecation plan </internals/deprecation>` for any features that
  443. have been removed. If you haven't updated your code within the
  444. deprecation timeline for a given feature, its removal may appear as a
  445. backwards incompatible change.
  446. allow_syncdb/allow_migrate
  447. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  448. While Django will still look at ``allow_syncdb`` methods even though they
  449. should be renamed to ``allow_migrate``, there is a subtle difference in which
  450. models get passed to these methods.
  451. For apps with migrations, ``allow_migrate`` will now get passed
  452. :ref:`historical models <historical-models>`, which are special versioned models
  453. without custom attributes, methods or managers. Make sure your ``allow_migrate``
  454. methods are only referring to fields or other items in ``model._meta``.
  455. App-loading changes
  456. ~~~~~~~~~~~~~~~~~~~
  457. Start-up sequence
  458. ^^^^^^^^^^^^^^^^^
  459. Django 1.7 loads application configurations and models as soon as it starts.
  460. While this behavior is more straightforward and is believed to be more robust,
  461. regressions cannot be ruled out. You may encounter the following exceptions:
  462. * ``RuntimeError: App registry isn't ready yet.`` This happens when importing
  463. an application configuration or a models module triggers code that depends
  464. on the app registry.
  465. For example, :func:`~django.utils.translation.ugettext()` uses the app
  466. registry to look up translation catalogs in applications. To translate at
  467. import time, you need :func:`~django.utils.translation.ugettext_lazy()`
  468. instead. (Using :func:`~django.utils.translation.ugettext()` would be a bug,
  469. because the translation would happen at import time, rather than at each
  470. request depending on the active language.)
  471. Executing database queries with the ORM at import time in models modules
  472. will also trigger this exception. The ORM cannot function properly until all
  473. models are available.
  474. * ``ImportError: cannot import name ...`` This happens if the import sequence
  475. ends up in a loop.
  476. To eliminate such problems, you should minimize dependencies between your
  477. models modules and do as little work as possible at import time. To avoid
  478. executing code at import time, you can move it into a function and cache its
  479. results. The code will be executed when you first need its results. This
  480. concept is known as "lazy evaluation".
  481. Standalone scripts
  482. ^^^^^^^^^^^^^^^^^^
  483. If you're using Django in a plain Python script — rather than a management
  484. command — and you rely on the :envvar:`DJANGO_SETTINGS_MODULE` environment
  485. variable, you must now explicitly initialize Django at the beginning of your
  486. script with::
  487. >>> import django
  488. >>> django.setup()
  489. Otherwise, you will hit ``RuntimeError: App registry isn't ready yet.``
  490. App registry consistency
  491. ^^^^^^^^^^^^^^^^^^^^^^^^
  492. It is no longer possible to have multiple installed applications with the same
  493. label. In previous versions of Django, this didn't always work correctly, but
  494. didn't crash outright either.
  495. If you have two apps with the same label, you should create an
  496. :class:`~django.apps.AppConfig` for one of them and override its
  497. :class:`~django.apps.AppConfig.label` there. You should then adjust your code
  498. wherever it references this application or its models with the old label.
  499. You should make sure that your project doesn't import models from applications
  500. that aren't in :setting:`INSTALLED_APPS`. Relations involving such models may
  501. not be created properly. Future versions of Django may forbid this entirely.
  502. Subclassing AppCommand
  503. ^^^^^^^^^^^^^^^^^^^^^^
  504. Subclasses of :class:`~django.core.management.AppCommand` must now implement a
  505. :meth:`~django.core.management.AppCommand.handle_app_config` method instead of
  506. ``handle_app()``. This method receives an :class:`~django.apps.AppConfig`
  507. instance instead of a models module.
  508. Introspecting applications
  509. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  510. Since :setting:`INSTALLED_APPS` now supports application configuration classes
  511. in addition to application modules, you should review code that accesses this
  512. setting directly and use the app registry (:attr:`django.apps.apps`) instead.
  513. The app registry has preserved some features of the old app cache. Even though
  514. the app cache was a private API, obsolete methods and arguments will be
  515. removed through a standard deprecation path, with the exception of the
  516. following changes that take effect immediately:
  517. * ``get_model`` raises :exc:`~exceptions.LookupError` instead of returning
  518. ``None`` when no model is found.
  519. * The ``only_installed`` argument of ``get_model`` and ``get_models`` no
  520. longer exists, nor does the ``seed_cache`` argument of ``get_model``.
  521. Behavior of ``LocMemCache`` regarding pickle errors
  522. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  523. An inconsistency existed in previous versions of Django regarding how pickle
  524. errors are handled by different cache backends.
  525. ``django.core.cache.backends.locmem.LocMemCache`` used to fail silently when
  526. such an error occurs, which is inconsistent with other backends and leads to
  527. cache-specific errors. This has been fixed in Django 1.7, see
  528. `Ticket #21200`_ for more details.
  529. .. _Ticket #21200: https://code.djangoproject.com/ticket/21200
  530. Cache keys are now generated from the request's absolute URL
  531. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  532. Previous versions of Django generated cache keys using a request's path and
  533. query string but not the scheme or host. If a Django application was serving
  534. multiple subdomains or domains, cache keys could collide. In Django 1.7, cache
  535. keys vary by the absolute URL of the request including scheme, host, path, and
  536. query string. For example, the URL portion of a cache key is now generated from
  537. ``http://www.example.com/path/to/?key=val`` rather than ``/path/to/?key=val``.
  538. The cache keys generated by Django 1.7 will be different from the keys
  539. generated by older versions of Django. After upgrading to Django 1.7, the first
  540. request to any previously cached URL will be a cache miss .
  541. Passing ``None`` to ``Manager.db_manager()``
  542. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  543. In previous versions of Django, it was possible to use
  544. ``db_manager(using=None)`` on a model manager instance to obtain a manager
  545. instance using default routing behavior, overriding any manually specified
  546. database routing. In Django 1.7, a value of ``None`` passed to db_manager will
  547. produce a router that *retains* any manually assigned database routing -- the
  548. manager will *not* be reset. This was necessary to resolve an inconsistency in
  549. the way routing information cascaded over joins. See `Ticket #13724`_ for more
  550. details.
  551. .. _Ticket #13724: https://code.djangoproject.com/ticket/13724
  552. pytz may be required
  553. ~~~~~~~~~~~~~~~~~~~~
  554. If your project handles datetimes before 1970 or after 2037 and Django raises
  555. a :exc:`~exceptions.ValueError` when encountering them, you will have to
  556. install pytz_. You may be affected by this problem if you use Django's time
  557. zone-related date formats or :mod:`django.contrib.syndication`.
  558. ``remove()`` and ``clear()`` methods of related managers
  559. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  560. The ``remove()`` and ``clear()`` methods of the related managers created by
  561. ``ForeignKey``, ``GenericForeignKey``, and ``ManyToManyField`` suffered from a
  562. number of issues. Some operations ran multiple data modifying queries without
  563. wrapping them in a transaction, and some operations didn't respect default
  564. filtering when it was present (i.e. when the default manager on the related
  565. model implemented a custom ``get_queryset()``).
  566. Fixing the issues introduced some backward incompatible changes:
  567. - The default implementation of ``remove()`` for ``ForeignKey`` related managers
  568. changed from a series of ``Model.save()`` calls to a single
  569. ``QuerySet.update()`` call. The change means that ``pre_save`` and
  570. ``post_save`` signals aren't sent anymore. You can use the ``bulk=False``
  571. keyword argument to revert to the previous behavior.
  572. - The ``remove()`` and ``clear()`` methods for ``GenericForeignKey`` related
  573. managers now perform bulk delete. The ``Model.delete()`` method isn't called
  574. on each instance anymore. You can use the ``bulk=False`` keyword argument to
  575. revert to the previous behavior.
  576. - The ``remove()`` and ``clear()`` methods for ``ManyToManyField`` related
  577. managers perform nested queries when filtering is involved, which may or
  578. may not be an issue depending on your database and your data itself.
  579. See :ref:`this note <nested-queries-performance>` for more details.
  580. .. _pytz: https://pypi.python.org/pypi/pytz/
  581. Miscellaneous
  582. ~~~~~~~~~~~~~
  583. * The :meth:`django.core.files.uploadhandler.FileUploadHandler.new_file()`
  584. method is now passed an additional ``content_type_extra`` parameter. If you
  585. have a custom :class:`~django.core.files.uploadhandler.FileUploadHandler`
  586. that implements ``new_file()``, be sure it accepts this new parameter.
  587. * :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`’s no longer
  588. delete instances when ``save(commit=False)`` is called. See
  589. :attr:`~django.forms.formsets.BaseFormSet.can_delete` for instructions on how
  590. to manually delete objects from deleted forms.
  591. * Loading empty fixtures emits a ``RuntimeWarning`` rather than raising
  592. :class:`~django.core.management.CommandError`.
  593. * :func:`django.contrib.staticfiles.views.serve` will now raise an
  594. :exc:`~django.http.Http404` exception instead of
  595. :exc:`~django.core.exceptions.ImproperlyConfigured` when :setting:`DEBUG`
  596. is ``False``. This change removes the need to conditionally add the view to
  597. your root URLconf, which in turn makes it safe to reverse by name. It also
  598. removes the ability for visitors to generate spurious HTTP 500 errors by
  599. requesting static files that don't exist or haven't been collected yet.
  600. * The :meth:`django.db.models.Model.__eq__` method is now defined in a
  601. way where instances of a proxy model and its base model are considered
  602. equal when primary keys match. Previously only instances of exact same
  603. class were considered equal on primary key match.
  604. * The :meth:`django.db.models.Model.__eq__` method has changed such that
  605. two ``Model`` instances without primary key values won't be considered
  606. equal (unless they are the same instance).
  607. * The :meth:`django.db.models.Model.__hash__` will now raise ``TypeError``
  608. when called on an instance without a primary key value. This is done to
  609. avoid mutable ``__hash__`` values in containers.
  610. * :class:`~django.db.models.AutoField` columns in SQLite databases will now be
  611. created using the ``AUTOINCREMENT`` option, which guarantees monotonic
  612. increments. This will cause primary key numbering behavior to change on
  613. SQLite, becoming consistent with most other SQL databases. This will only
  614. apply to newly created tables. If you have a database created with an older
  615. version of Django, you will need to migrate it to take advantage of this
  616. feature. For example, you could do the following:
  617. #) Use :djadmin:`dumpdata` to save your data.
  618. #) Rename the existing database file (keep it as a backup).
  619. #) Run :djadmin:`migrate` to create the updated schema.
  620. #) Use :djadmin:`loaddata` to import the fixtures you exported in (1).
  621. * ``django.contrib.auth.models.AbstractUser`` no longer defines a
  622. :meth:`~django.db.models.Model.get_absolute_url()` method. The old definition
  623. returned ``"/users/%s/" % urlquote(self.username)`` which was arbitrary
  624. since applications may or may not define such a url in ``urlpatterns``.
  625. Define a ``get_absolute_url()`` method on your own custom user object or use
  626. :setting:`ABSOLUTE_URL_OVERRIDES` if you want a URL for your user.
  627. * The static asset-serving functionality of the
  628. :class:`django.test.LiveServerTestCase` class has been simplified: Now it's
  629. only able to serve content already present in :setting:`STATIC_ROOT` when
  630. tests are run. The ability to transparently serve all the static assets
  631. (similarly to what one gets with :setting:`DEBUG = True <DEBUG>` at
  632. development-time) has been moved to a new class that lives in the
  633. ``staticfiles`` application (the one actually in charge of such feature):
  634. :class:`django.contrib.staticfiles.testing.StaticLiveServerCase`. In other
  635. words, ``LiveServerTestCase`` itself is less powerful but at the same time
  636. has less magic.
  637. Rationale behind this is removal of dependency of non-contrib code on
  638. contrib applications.
  639. * The old cache URI syntax (e.g. ``"locmem://"``) is no longer supported. It
  640. still worked, even though it was not documented or officially supported. If
  641. you're still using it, please update to the current :setting:`CACHES` syntax.
  642. * The default ordering of ``Form`` fields in case of inheritance has changed to
  643. follow normal Python MRO. Fields are now discovered by iterating through the
  644. MRO in reverse with the topmost class coming last. This only affects you if
  645. you relied on the default field ordering while having fields defined on both
  646. the current class *and* on a parent ``Form``.
  647. * The ``required`` argument of
  648. :class:`~django.forms.extras.widgets.SelectDateWidget` has been removed.
  649. This widget now respects the form field's ``is_required`` attribute like
  650. other widgets.
  651. * :meth:`~django.db.models.query.QuerySet.select_related` now chains in the
  652. same way as other similar calls like ``prefetch_related``. That is,
  653. ``select_related('foo', 'bar')`` is equivalent to
  654. ``select_related('foo').select_related('bar')``. Previously the latter would
  655. have been equivalent to ``select_related('bar')``.
  656. * GeoDjango dropped support for GEOS < 3.1.
  657. Features deprecated in 1.7
  658. ==========================
  659. ``django.core.cache.get_cache``
  660. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  661. :func:`django.core.cache.get_cache` has been supplanted by
  662. :data:`django.core.cache.caches`.
  663. ``django.utils.dictconfig``/``django.utils.importlib``
  664. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  665. ``django.utils.dictconfig`` and ``django.utils.importlib`` were copies of
  666. respectively :mod:`logging.config` and :mod:`importlib` provided for Python
  667. versions prior to 2.7. They have been deprecated.
  668. ``django.utils.tzinfo``
  669. ~~~~~~~~~~~~~~~~~~~~~~~
  670. ``django.utils.tzinfo`` provided two :class:`~datetime.tzinfo` subclasses,
  671. ``LocalTimezone`` and ``FixedOffset``. They've been deprecated in favor of
  672. more correct alternatives provided by :mod:`django.utils.timezone`,
  673. :func:`django.utils.timezone.get_default_timezone` and
  674. :func:`django.utils.timezone.get_fixed_timezone`.
  675. ``django.utils.unittest``
  676. ~~~~~~~~~~~~~~~~~~~~~~~~~
  677. ``django.utils.unittest`` provided uniform access to the ``unittest2`` library
  678. on all Python versions. Since ``unittest2`` became the standard library's
  679. :mod:`unittest` module in Python 2.7, and Django 1.7 drops support for older
  680. Python versions, this module isn't useful anymore. It has been deprecated. Use
  681. :mod:`unittest` instead.
  682. ``django.utils.datastructures.SortedDict``
  683. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  684. As :class:`~collections.OrderedDict` was added to the standard library in
  685. Python 2.7, :class:`~django.utils.datastructures.SortedDict` is no longer
  686. needed and has been deprecated.
  687. Custom SQL location for models package
  688. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  689. Previously, if models were organized in a package (``myapp/models/``) rather
  690. than simply ``myapp/models.py``, Django would look for :ref:`initial SQL data
  691. <initial-sql>` in ``myapp/models/sql/``. This bug has been fixed so that Django
  692. will search ``myapp/sql/`` as documented. The old location will continue to
  693. work until Django 1.9.
  694. ``declared_fieldsets`` attribute on ``ModelAdmin``
  695. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  696. ``ModelAdmin.declared_fieldsets`` has been deprecated. Despite being a private
  697. API, it will go through a regular deprecation path. This attribute was mostly
  698. used by methods that bypassed ``ModelAdmin.get_fieldsets()`` but this was
  699. considered a bug and has been addressed.
  700. ``syncdb``
  701. ~~~~~~~~~~
  702. The ``syncdb`` command has been deprecated in favour of the new ``migrate``
  703. command. ``migrate`` takes the same arguments as ``syncdb`` used to plus a few
  704. more, so it's safe to just change the name you're calling and nothing else.
  705. ``util`` modules renamed to ``utils``
  706. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  707. The following instances of ``util.py`` in the Django codebase have been renamed
  708. to ``utils.py`` in an effort to unify all util and utils references:
  709. * ``django.contrib.admin.util``
  710. * ``django.contrib.gis.db.backends.util``
  711. * ``django.db.backends.util``
  712. * ``django.forms.util``
  713. ``get_formsets`` method on ``ModelAdmin``
  714. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  715. ``ModelAdmin.get_formsets`` has been deprecated in favor of the new
  716. :meth:`~django.contrib.admin.ModelAdmin.get_formsets_with_inlines`, in order to
  717. better handle the case of selecting showing inlines on a ``ModelAdmin``.
  718. ``IPAddressField``
  719. ~~~~~~~~~~~~~~~~~~
  720. The :class:`django.db.models.IPAddressField` and
  721. :class:`django.forms.IPAddressField` fields have been deprecated in favor of
  722. :class:`django.db.models.GenericIPAddressField` and
  723. :class:`django.forms.GenericIPAddressField`.
  724. ``BaseMemcachedCache._get_memcache_timeout`` method
  725. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  726. The ``BaseMemcachedCache._get_memcache_timeout()`` method has been renamed to
  727. ``get_backend_timeout()``. Despite being a private API, it will go through the
  728. normal deprecation.
  729. Natural key serialization options
  730. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  731. The ``--natural`` and ``-n`` options for :djadmin:`dumpdata` have been
  732. deprecated. Use :djadminopt:`--natural-foreign` instead.
  733. Similarly, the ``use_natural_keys`` argument for ``serializers.serialize()``
  734. has been deprecated. Use ``use_natural_foreign_keys`` instead.
  735. Merging of ``POST`` and ``GET`` arguments into ``WSGIRequest.REQUEST``
  736. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  737. It was already strongly suggested that you use ``GET`` and ``POST`` instead of
  738. ``REQUEST``, because the former are more explicit. The property ``REQUEST`` is
  739. deprecated and will be removed in Django 1.9.
  740. ``django.utils.datastructures.MergeDict`` class
  741. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  742. ``MergeDict`` exists primarily to support merging ``POST`` and ``GET``
  743. arguments into a ``REQUEST`` property on ``WSGIRequest``. To merge
  744. dictionaries, use ``dict.update()`` instead. The class ``MergeDict`` is
  745. deprecated and will be removed in Django 1.9.
  746. Language codes ``zh-cn``, ``zh-tw`` and ``fy-nl``
  747. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  748. The currently used language codes for Simplified Chinese ``zh-cn``,
  749. Traditional Chinese ``zh-tw`` and (Western) Frysian ``fy-nl`` are deprecated
  750. and should be replaced by the language codes ``zh-hans``, ``zh-hant`` and
  751. ``fy`` respectively. If you use these language codes, you should rename the
  752. locale directories and update your settings to reflect these changes. The
  753. deprecated language codes will be removed in Django 1.9.
  754. ``django.utils.functional.memoize`` function
  755. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  756. The function ``memoize`` is deprecated and should be replaced by the
  757. ``functools.lru_cache`` decorator (available from Python 3.2 onwards).
  758. Django ships a backport of this decorator for older Python versions and it's
  759. available at ``django.utils.lru_cache.lru_cache``. The deprecated function will
  760. be removed in Django 1.9.
  761. Geo Sitemaps
  762. ~~~~~~~~~~~~
  763. Google has retired support for the Geo Sitemaps format. Hence Django support
  764. for Geo Sitemaps is deprecated and will be removed in Django 1.8.
  765. Passing callable arguments to queryset methods
  766. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  767. Callable arguments for querysets were an undocumented feature that was
  768. unreliable. It's been deprecated and will be removed in Django 1.9.
  769. Callable arguments were evaluated when a queryset was constructed rather than
  770. when it was evaluated, thus this feature didn't offer any benefit compared to
  771. evaluating arguments before passing them to queryset and created confusion that
  772. the arguments may have been evaluated at query time.
  773. ``ADMIN_FOR`` setting
  774. ~~~~~~~~~~~~~~~~~~~~~
  775. The ``ADMIN_FOR`` feature, part of the admindocs, has been removed. You can
  776. remove the setting from your configuration at your convenience.