1 .. _misc-api-stability:
7 :ref:`The release of Django 1.0 <releases-1.0>` comes with a promise of API
8 stability and forwards-compatibility. In a nutshell, this means that code you
9 develop against Django 1.0 will continue to work against 1.1 unchanged, and you
10 should need to make only minor changes for any 1.X release.
15 In this context, stable means:
17 - All the public APIs -- everything documented in the linked documents below,
18 and all methods that don't begin with an underscore -- will not be moved or
19 renamed without providing backwards-compatible aliases.
21 - If new features are added to these APIs -- which is quite possible --
22 they will not break or change the meaning of existing methods. In other
23 words, "stable" does not (necessarily) mean "complete."
25 - If, for some reason, an API declared stable must be removed or replaced, it
26 will be declared deprecated but will remain in the API for at least two
27 minor version releases. Warnings will be issued when the deprecated method
30 See :ref:`official-releases` for more details on how Django's version
31 numbering scheme works, and how features will be deprecated.
33 - We'll only break backwards compatibility of these APIs if a bug or
34 security hole makes it completely unavoidable.
39 In general, everything covered in the documentation -- with the exception of
40 anything in the :ref:`internals area <internals-index>` is considered stable as
41 of 1.0. This includes these APIs:
43 - :ref:`Authorization <topics-auth>`
45 - :ref:`Caching <topics-cache>`.
47 - :ref:`Model definition, managers, querying and transactions
50 - :ref:`Sending e-mail <topics-email>`.
52 - :ref:`File handling and storage <topics-files>`
54 - :ref:`Forms <topics-forms-index>`
56 - :ref:`HTTP request/response handling <topics-http-index>`, including file
57 uploads, middleware, sessions, URL resolution, view, and shortcut APIs.
59 - :ref:`Generic views <topics-http-generic-views>`.
61 - :ref:`Internationalization <topics-i18n>`.
63 - :ref:`Pagination <topics-pagination>`
65 - :ref:`Serialization <topics-serialization>`
67 - :ref:`Signals <topics-signals>`
69 - :ref:`Templates <topics-templates>`, including the language, Python-level
70 :ref:`template APIs <ref-templates-index>`, and :ref:`custom template tags
71 and libraries <howto-custom-template-tags>`. We may add new template
72 tags in the future and the names may inadvertently clash with
73 external template tags. Before adding any such tags, we'll ensure that
74 Django raises an error if it tries to load tags with duplicate names.
76 - :ref:`Testing <topics-testing>`
78 - :ref:`django-admin utility <ref-django-admin>`.
80 - :ref:`Built-in middleware <ref-middleware>`
82 - :ref:`Request/response objects <ref-request-response>`.
84 - :ref:`Settings <ref-settings>`. Note, though that while the :ref:`list of
85 built-in settings <ref-settings>` can be considered complete we may -- and
86 probably will -- add new settings in future versions. This is one of those
87 places where "'stable' does not mean 'complete.'"
89 - :ref:`Built-in signals <ref-signals>`. Like settings, we'll probably add
90 new signals in the future, but the existing ones won't break.
92 - :ref:`Unicode handling <ref-unicode>`.
94 - Everything covered by the :ref:`HOWTO guides <howto-index>`.
99 Most of the modules in ``django.utils`` are designed for internal use. Only the following parts of ``django.utils`` can be considered stable:
101 - ``django.utils.cache``
102 - ``django.utils.datastructures.SortedDict`` -- only this single class; the
103 rest of the module is for internal use.
104 - ``django.utils.encoding``
105 - ``django.utils.feedgenerator``
106 - ``django.utils.http``
107 - ``django.utils.safestring``
108 - ``django.utils.translation``
109 - ``django.utils.tzinfo``
114 There are a few exceptions to this stability and backwards-compatibility
120 If we become aware of a security problem -- hopefully by someone following our
121 :ref:`security reporting policy <reporting-security-issues>` -- we'll do
122 everything necessary to fix it. This might mean breaking backwards compatibility; security trumps the compatibility guarantee.
124 Contributed applications (``django.contrib``)
125 ---------------------------------------------
127 While we'll make every effort to keep these APIs stable -- and have no plans to
128 break any contrib apps -- this is an area that will have more flux between
129 releases. As the web evolves, Django must evolve with it.
131 However, any changes to contrib apps will come with an important guarantee:
132 we'll make sure it's always possible to use an older version of a contrib app if
133 we need to make changes. Thus, if Django 1.5 ships with a backwards-incompatible
134 ``django.contrib.flatpages``, we'll make sure you can still use the Django 1.4
135 version alongside Django 1.5. This will continue to allow for easy upgrades.
137 Historically, apps in ``django.contrib`` have been more stable than the core, so
138 in practice we probably won't have to ever make this exception. However, it's
139 worth noting if you're building apps that depend on ``django.contrib``.
141 APIs marked as internal
142 -----------------------
144 Certain APIs are explicitly marked as "internal" in a couple of ways:
146 - Some documentation refers to internals and mentions them as such. If the
147 documentation says that something is internal, we reserve the right to
150 - Functions, methods, and other objects prefixed by a leading underscore
151 (``_``). This is the standard Python way of indicating that something is
152 private; if any method starts with a single ``_``, it's an internal API.