<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>API stability — Django 1.4.5 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.4.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="top" title="Django 1.4.5 documentation" href="../index.html" /> <link rel="up" title="Meta-documentation and miscellany" href="index.html" /> <link rel="next" title="Design philosophies" href="design-philosophies.html" /> <link rel="prev" title="Meta-documentation and miscellany" href="index.html" /> <script type="text/javascript" src="../templatebuiltins.js"></script> <script type="text/javascript"> (function($) { if (!django_template_builtins) { // templatebuiltins.js missing, do nothing. return; } $(document).ready(function() { // Hyperlink Django template tags and filters var base = "../ref/templates/builtins.html"; if (base == "#") { // Special case for builtins.html itself base = ""; } // Tags are keywords, class '.k' $("div.highlight\\-html\\+django span.k").each(function(i, elem) { var tagname = $(elem).text(); if ($.inArray(tagname, django_template_builtins.ttags) != -1) { var fragment = tagname.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>"); } }); // Filters are functions, class '.nf' $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { var filtername = $(elem).text(); if ($.inArray(filtername, django_template_builtins.tfilters) != -1) { var fragment = filtername.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>"); } }); }); })(jQuery); </script> </head> <body> <div class="document"> <div id="custom-doc" class="yui-t6"> <div id="hd"> <h1><a href="../index.html">Django 1.4.5 documentation</a></h1> <div id="global-nav"> <a title="Home page" href="../index.html">Home</a> | <a title="Table of contents" href="../contents.html">Table of contents</a> | <a title="Global index" href="../genindex.html">Index</a> | <a title="Module index" href="../py-modindex.html">Modules</a> </div> <div class="nav"> « <a href="index.html" title="Meta-documentation and miscellany">previous</a> | <a href="index.html" title="Meta-documentation and miscellany" accesskey="U">up</a> | <a href="design-philosophies.html" title="Design philosophies">next</a> »</div> </div> <div id="bd"> <div id="yui-main"> <div class="yui-b"> <div class="yui-g" id="misc-api-stability"> <div class="section" id="s-api-stability"> <span id="api-stability"></span><h1>API stability<a class="headerlink" href="#api-stability" title="Permalink to this headline">¶</a></h1> <p><a class="reference internal" href="../releases/1.0.html"><em>The release of Django 1.0</em></a> comes with a promise of API stability and forwards-compatibility. In a nutshell, this means that code you develop against Django 1.0 will continue to work against 1.1 unchanged, and you should need to make only minor changes for any 1.X release.</p> <div class="section" id="s-what-stable-means"> <span id="what-stable-means"></span><h2>What “stable” means<a class="headerlink" href="#what-stable-means" title="Permalink to this headline">¶</a></h2> <p>In this context, stable means:</p> <ul> <li><p class="first">All the public APIs – everything documented in the linked documents below, and all methods that don’t begin with an underscore – will not be moved or renamed without providing backwards-compatible aliases.</p> </li> <li><p class="first">If new features are added to these APIs – which is quite possible – they will not break or change the meaning of existing methods. In other words, “stable” does not (necessarily) mean “complete.”</p> </li> <li><p class="first">If, for some reason, an API declared stable must be removed or replaced, it will be declared deprecated but will remain in the API for at least two minor version releases. Warnings will be issued when the deprecated method is called.</p> <p>See <a class="reference internal" href="../internals/release-process.html#official-releases"><em>Official releases</em></a> for more details on how Django’s version numbering scheme works, and how features will be deprecated.</p> </li> <li><p class="first">We’ll only break backwards compatibility of these APIs if a bug or security hole makes it completely unavoidable.</p> </li> </ul> </div> <div class="section" id="s-stable-apis"> <span id="stable-apis"></span><h2>Stable APIs<a class="headerlink" href="#stable-apis" title="Permalink to this headline">¶</a></h2> <p>In general, everything covered in the documentation – with the exception of anything in the <a class="reference internal" href="../internals/index.html"><em>internals area</em></a> is considered stable as of 1.0. This includes these APIs:</p> <ul class="simple"> <li><a class="reference internal" href="../topics/auth.html"><em>Authorization</em></a></li> <li><a class="reference internal" href="../topics/cache.html"><em>Caching</em></a>.</li> <li><a class="reference internal" href="../topics/db/index.html"><em>Model definition, managers, querying and transactions</em></a></li> <li><a class="reference internal" href="../topics/email.html"><em>Sending email</em></a>.</li> <li><a class="reference internal" href="../topics/files.html"><em>File handling and storage</em></a></li> <li><a class="reference internal" href="../topics/forms/index.html"><em>Forms</em></a></li> <li><a class="reference internal" href="../topics/http/index.html"><em>HTTP request/response handling</em></a>, including file uploads, middleware, sessions, URL resolution, view, and shortcut APIs.</li> <li><a class="reference internal" href="../topics/http/generic-views.html"><em>Generic views</em></a>.</li> <li><a class="reference internal" href="../topics/i18n/index.html"><em>Internationalization</em></a>.</li> <li><a class="reference internal" href="../topics/pagination.html"><em>Pagination</em></a></li> <li><a class="reference internal" href="../topics/serialization.html"><em>Serialization</em></a></li> <li><a class="reference internal" href="../topics/signals.html"><em>Signals</em></a></li> <li><a class="reference internal" href="../topics/templates.html"><em>Templates</em></a>, including the language, Python-level <a class="reference internal" href="../ref/templates/index.html"><em>template APIs</em></a>, and <a class="reference internal" href="../howto/custom-template-tags.html"><em>custom template tags and libraries</em></a>. We may add new template tags in the future and the names may inadvertently clash with external template tags. Before adding any such tags, we’ll ensure that Django raises an error if it tries to load tags with duplicate names.</li> <li><a class="reference internal" href="../topics/testing.html"><em>Testing</em></a></li> <li><a class="reference internal" href="../ref/django-admin.html"><em>django-admin utility</em></a>.</li> <li><a class="reference internal" href="../ref/middleware.html"><em>Built-in middleware</em></a></li> <li><a class="reference internal" href="../ref/request-response.html"><em>Request/response objects</em></a>.</li> <li><a class="reference internal" href="../ref/settings.html"><em>Settings</em></a>. Note, though that while the <a class="reference internal" href="../ref/settings.html"><em>list of built-in settings</em></a> can be considered complete we may – and probably will – add new settings in future versions. This is one of those places where “‘stable’ does not mean ‘complete.’”</li> <li><a class="reference internal" href="../ref/signals.html"><em>Built-in signals</em></a>. Like settings, we’ll probably add new signals in the future, but the existing ones won’t break.</li> <li><a class="reference internal" href="../ref/unicode.html"><em>Unicode handling</em></a>.</li> <li>Everything covered by the <a class="reference internal" href="../howto/index.html"><em>HOWTO guides</em></a>.</li> </ul> <div class="section" id="s-django-utils"> <span id="django-utils"></span><h3><tt class="docutils literal"><span class="pre">django.utils</span></tt><a class="headerlink" href="#django-utils" title="Permalink to this headline">¶</a></h3> <p>Most of the modules in <tt class="docutils literal"><span class="pre">django.utils</span></tt> are designed for internal use. Only the following parts of <a class="reference internal" href="../ref/utils.html"><em>django.utils</em></a> can be considered stable:</p> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">django.utils.cache</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.datastructures.SortedDict</span></tt> – only this single class; the rest of the module is for internal use.</li> <li><tt class="docutils literal"><span class="pre">django.utils.encoding</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.feedgenerator</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.http</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.safestring</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.translation</span></tt></li> <li><tt class="docutils literal"><span class="pre">django.utils.tzinfo</span></tt></li> </ul> </div> </div> <div class="section" id="s-exceptions"> <span id="exceptions"></span><h2>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h2> <p>There are a few exceptions to this stability and backwards-compatibility promise.</p> <div class="section" id="s-security-fixes"> <span id="security-fixes"></span><h3>Security fixes<a class="headerlink" href="#security-fixes" title="Permalink to this headline">¶</a></h3> <p>If we become aware of a security problem – hopefully by someone following our <a class="reference internal" href="../internals/contributing/bugs-and-features.html#reporting-security-issues"><em>security reporting policy</em></a> – we’ll do everything necessary to fix it. This might mean breaking backwards compatibility; security trumps the compatibility guarantee.</p> </div> <div class="section" id="s-contributed-applications-django-contrib"> <span id="contributed-applications-django-contrib"></span><h3>Contributed applications (<tt class="docutils literal"><span class="pre">django.contrib</span></tt>)<a class="headerlink" href="#contributed-applications-django-contrib" title="Permalink to this headline">¶</a></h3> <p>While we’ll make every effort to keep these APIs stable – and have no plans to break any contrib apps – this is an area that will have more flux between releases. As the Web evolves, Django must evolve with it.</p> <p>However, any changes to contrib apps will come with an important guarantee: we’ll make sure it’s always possible to use an older version of a contrib app if we need to make changes. Thus, if Django 1.5 ships with a backwards-incompatible <tt class="docutils literal"><span class="pre">django.contrib.flatpages</span></tt>, we’ll make sure you can still use the Django 1.4 version alongside Django 1.5. This will continue to allow for easy upgrades.</p> <p>Historically, apps in <tt class="docutils literal"><span class="pre">django.contrib</span></tt> have been more stable than the core, so in practice we probably won’t have to ever make this exception. However, it’s worth noting if you’re building apps that depend on <tt class="docutils literal"><span class="pre">django.contrib</span></tt>.</p> </div> <div class="section" id="s-apis-marked-as-internal"> <span id="apis-marked-as-internal"></span><h3>APIs marked as internal<a class="headerlink" href="#apis-marked-as-internal" title="Permalink to this headline">¶</a></h3> <p>Certain APIs are explicitly marked as “internal” in a couple of ways:</p> <ul class="simple"> <li>Some documentation refers to internals and mentions them as such. If the documentation says that something is internal, we reserve the right to change it.</li> <li>Functions, methods, and other objects prefixed by a leading underscore (<tt class="docutils literal"><span class="pre">_</span></tt>). This is the standard Python way of indicating that something is private; if any method starts with a single <tt class="docutils literal"><span class="pre">_</span></tt>, it’s an internal API.</li> </ul> </div> <div class="section" id="s-local-flavors"> <span id="s-misc-api-stability-localflavor"></span><span id="local-flavors"></span><span id="misc-api-stability-localflavor"></span><h3>Local flavors<a class="headerlink" href="#local-flavors" title="Permalink to this headline">¶</a></h3> <div class="versionchanged"> <span class="title">Changed in Django 1.3:</span> <a class="reference internal" href="../releases/1.3.html"><em>Please see the release notes</em></a></div> <p><a class="reference internal" href="../ref/contrib/localflavor.html#module-django.contrib.localflavor" title="django.contrib.localflavor: A collection of various Django snippets that are useful only for a particular country or culture."><tt class="xref py py-mod docutils literal"><span class="pre">django.contrib.localflavor</span></tt></a> contains assorted pieces of code that are useful for particular countries or cultures. This data is local in nature, and is subject to change on timelines that will almost never correlate with Django’s own release schedules. For example, a common change is to split a province into two new provinces, or to rename an existing province.</p> <p>These changes present two competing compatibility issues. Moving forward, displaying the names of deprecated, renamed and dissolved provinces in a selection widget is bad from a user interface perspective. However, maintaining full backwards compatibility requires that we support historical values that may be stored in a database – including values that may no longer be valid.</p> <p>Therefore, Django has the following policy with respect to changes in local flavor:</p> <ul class="simple"> <li>At the time of a Django release, the data and algorithms contained in <a class="reference internal" href="../ref/contrib/localflavor.html#module-django.contrib.localflavor" title="django.contrib.localflavor: A collection of various Django snippets that are useful only for a particular country or culture."><tt class="xref py py-mod docutils literal"><span class="pre">django.contrib.localflavor</span></tt></a> will, to the best of our ability, reflect the officially gazetted policies of the appropriate local government authority. If a province has been added, altered, or removed, that change will be reflected in Django’s localflavor.</li> <li>These changes will <em>not</em> be backported to the previous stable release. Upgrading a minor version of Django should not require any data migration or audits for UI changes; therefore, if you want to get the latest province list, you will either need to upgrade your Django install, or backport the province list you need.</li> <li>For one release, the affected localflavor module will raise a <tt class="docutils literal"><span class="pre">RuntimeWarning</span></tt> when it is imported.</li> <li>The change will be announced in the release notes as a backwards incompatible change requiring attention. The change will also be annotated in the documentation for the localflavor module.</li> <li>Where necessary and feasible, a migration script will be provided to aid the migration process.</li> </ul> <p>For example, Django 1.2 contains an Indonesian localflavor. It has a province list that includes “Nanggroe Aceh Darussalam (NAD)” as a province. The Indonesian government has changed the official name of the province to “Aceh (ACE)”. As a result, Django 1.3 does <em>not</em> contain “Nanggroe Aceh Darussalam (NAD)” in the province list, but <em>does</em> contain “Aceh (ACE)”.</p> </div> </div> </div> </div> </div> </div> <div class="yui-b" id="sidebar"> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">API stability</a><ul> <li><a class="reference internal" href="#what-stable-means">What “stable” means</a></li> <li><a class="reference internal" href="#stable-apis">Stable APIs</a><ul> <li><a class="reference internal" href="#django-utils"><tt class="docutils literal"><span class="pre">django.utils</span></tt></a></li> </ul> </li> <li><a class="reference internal" href="#exceptions">Exceptions</a><ul> <li><a class="reference internal" href="#security-fixes">Security fixes</a></li> <li><a class="reference internal" href="#contributed-applications-django-contrib">Contributed applications (<tt class="docutils literal"><span class="pre">django.contrib</span></tt>)</a></li> <li><a class="reference internal" href="#apis-marked-as-internal">APIs marked as internal</a></li> <li><a class="reference internal" href="#local-flavors">Local flavors</a></li> </ul> </li> </ul> </li> </ul> <h3>Browse</h3> <ul> <li>Prev: <a href="index.html">Meta-documentation and miscellany</a></li> <li>Next: <a href="design-philosophies.html">Design philosophies</a></li> </ul> <h3>You are here:</h3> <ul> <li> <a href="../index.html">Django 1.4.5 documentation</a> <ul><li><a href="index.html">Meta-documentation and miscellany</a> <ul><li>API stability</li></ul> </li></ul> </li> </ul> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/misc/api-stability.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <h3>Last update:</h3> <p class="topless">Feb 21, 2013</p> </div> </div> <div id="ft"> <div class="nav"> « <a href="index.html" title="Meta-documentation and miscellany">previous</a> | <a href="index.html" title="Meta-documentation and miscellany" accesskey="U">up</a> | <a href="design-philosophies.html" title="Design philosophies">next</a> »</div> </div> </div> <div class="clearer"></div> </div> </body> </html>