{"title":"The Django source code repository","version":"2.1","locale":"fr","docname":"internals/git","url":"/fr/2.1/internals/git/","canonical":"https://djangodocs.dev/fr/2.1/internals/git/","summary":"When deploying a Django application into a real production environment, you will almost always want to use an official packaged release of Django.","html":"<h1>The Django source code repository<a class=\"heading-anchor\" href=\"#the-django-source-code-repository\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>When deploying a Django application into a real production environment, you\nwill almost always want to use <a class=\"reference external\" href=\"https://www.djangoproject.com/download/\">an official packaged release of Django</a>.</p>\n<p>However, if you’d like to try out in-development code from an upcoming release\nor contribute to the development of Django, you’ll need to obtain a clone of\nDjango’s source code repository.</p>\n<p>This document covers the way the code repository is laid out and how to work\nwith and find things in it.</p>\n<section id=\"high-level-overview\">\n<h2>High-level overview<a class=\"heading-anchor\" href=\"#high-level-overview\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The Django source code repository uses <a class=\"reference external\" href=\"https://git-scm.com/\">Git</a> to track changes to the code\nover time, so you’ll need a copy of the Git client (a program called <code class=\"docutils literal notranslate\">git</code>)\non your computer, and you’ll want to familiarize yourself with the basics of\nhow Git works.</p>\n<p>Git’s website offers downloads for various operating systems. The site also\ncontains vast amounts of <a class=\"reference external\" href=\"https://git-scm.com/documentation\">documentation</a>.</p>\n<p>The Django Git repository is located online at <a class=\"reference external\" href=\"https://github.com/django/django\">github.com/django/django</a>. It contains the full source code for all\nDjango releases, which you can browse online.</p>\n<p>The Git repository includes several <a class=\"reference external\" href=\"https://github.com/django/django/branches\">branches</a>:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">master</code> contains the main in-development code which will become\nthe next packaged release of Django. This is where most development\nactivity is focused.</p></li>\n<li><p><code class=\"docutils literal notranslate\">stable/A.B.x</code> are the branches where release preparation work happens.\nThey are also used for bugfix and security releases which occur as necessary\nafter the initial release of a feature version.</p></li>\n<li><p><code class=\"docutils literal notranslate\">soc20XX/&lt;project&gt;</code> branches were used by students who worked on Django\nduring the 2009 and 2010 Google Summer of Code programs.</p></li>\n<li><p><code class=\"docutils literal notranslate\">attic/&lt;project&gt;</code> branches were used to develop major or experimental new\nfeatures without affecting the rest of Django’s code.</p></li>\n</ul>\n<p>The Git repository also contains <a class=\"reference external\" href=\"https://github.com/django/django/tags\">tags</a>. These are the exact revisions from\nwhich packaged Django releases were produced, since version 1.0.</p>\n<p>The source code for the <a class=\"reference external\" href=\"https://www.djangoproject.com/\">Djangoproject.com</a>\nwebsite can be found at <a class=\"reference external\" href=\"https://github.com/django/djangoproject.com\">github.com/django/djangoproject.com</a>.</p>\n</section>\n<section id=\"the-master-branch\">\n<h2>The master branch<a class=\"heading-anchor\" href=\"#the-master-branch\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>If you’d like to try out the in-development code for the next release of\nDjango, or if you’d like to contribute to Django by fixing bugs or developing\nnew features, you’ll want to get the code from the master branch.</p>\n<p>Note that this will get <em>all</em> of Django: in addition to the top-level\n<code class=\"docutils literal notranslate\">django</code> module containing Python code, you’ll also get a copy of Django’s\ndocumentation, test suite, packaging scripts and other miscellaneous bits.\nDjango’s code will be present in your clone as a directory named\n<code class=\"docutils literal notranslate\">django</code>.</p>\n<p>To try out the in-development code with your own applications, simply place\nthe directory containing your clone on your Python import path. Then\n<code class=\"docutils literal notranslate\">import</code> statements which look for Django will find the <code class=\"docutils literal notranslate\">django</code> module\nwithin your clone.</p>\n<p>If you’re going to be working on Django’s code (say, to fix a bug or\ndevelop a new feature), you can probably stop reading here and move\nover to <a class=\"reference internal\" href=\"/fr/2.1/internals/contributing/\"><span class=\"doc\">the documentation for contributing to Django</span></a>, which covers things like the preferred\ncoding style and how to generate and submit a patch.</p>\n</section>\n<section id=\"other-branches\">\n<h2>Other branches<a class=\"heading-anchor\" href=\"#other-branches\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django uses branches to prepare for releases of Django.</p>\n<p>In the past when Django was hosted on Subversion, branches were also used for\nfeature development. Now Django is hosted on Git and feature development is\ndone on contributor’s forks, but the Subversion feature branches remain in Git\nfor historical reference.</p>\n<section id=\"stable-branches\">\n<h3>Les branches stables<a class=\"heading-anchor\" href=\"#stable-branches\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>These branches can be found in the repository as <code class=\"docutils literal notranslate\">stable/A.B.x</code>\nbranches and will be created right after the first alpha is tagged.</p>\n<p>For example, immediately after <em>Django 1.5 alpha 1</em> was tagged, the branch\n<code class=\"docutils literal notranslate\">stable/1.5.x</code> was created and all further work on preparing the code for the\nfinal 1.5 release was done there.</p>\n<p>These branches also provide bugfix and security support as described in\n<a class=\"reference internal\" href=\"/fr/2.1/internals/release-process/#supported-versions-policy\"><span class=\"std std-ref\">Versions prises en charge</span></a>.</p>\n<p>For example, after the release of Django 1.5, the branch <code class=\"docutils literal notranslate\">stable/1.5.x</code>\nreceives only fixes for security and critical stability bugs, which are\neventually released as Django 1.5.1 and so on, <code class=\"docutils literal notranslate\">stable/1.4.x</code> receives only\nsecurity and data loss fixes, and <code class=\"docutils literal notranslate\">stable/1.3.x</code> no longer receives any\nupdates.</p>\n<aside class=\"admonition-historical-information admonition\" role=\"note\">\n<p class=\"admonition-title\">Historical information</p>\n<p>This policy for handling <code class=\"docutils literal notranslate\">stable/A.B.x</code> branches was adopted starting\nwith the Django 1.5 release cycle.</p>\n<p>Previously, these branches weren’t created until right after the releases\nand the stabilization work occurred on the main repository branch. Thus,\nno new feature development work for the next release of Django could be\ncommitted until the final release happened.</p>\n<p>For example, shortly after the release of Django 1.3 the branch\n<code class=\"docutils literal notranslate\">stable/1.3.x</code> was created. Official support for that release has expired,\nand so it no longer receives direct maintenance from the Django project.\nHowever, that and all other similarly named branches continue to exist, and\ninterested community members have occasionally used them to provide\nunofficial support for old Django releases.</p>\n</aside>\n</section>\n<section id=\"feature-development-branches\">\n<h3>Feature-development branches<a class=\"heading-anchor\" href=\"#feature-development-branches\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"admonition-historical-information admonition\" role=\"note\">\n<p class=\"admonition-title\">Historical information</p>\n<p>Since Django moved to Git in 2012, anyone can clone the repository and\ncreate their own branches, alleviating the need for official branches in\nthe source code repository.</p>\n<p>The following section is mostly useful if you’re exploring the repository’s\nhistory, for example if you’re trying to understand how some features were\ndesigned.</p>\n</aside>\n<p>Feature-development branches tend by their nature to be temporary. Some\nproduce successful features which are merged back into Django’s master to\nbecome part of an official release, but others do not; in either case, there\ncomes a time when the branch is no longer being actively worked on by any\ndeveloper. At this point the branch is considered closed.</p>\n<p>Unfortunately, Django used to be maintained with the Subversion revision\ncontrol system, that has no standard way of indicating this. As a workaround,\nbranches of Django which are closed and no longer maintained were moved into\n<code class=\"docutils literal notranslate\">attic</code>.</p>\n<p>For reference, the following are branches whose code eventually became\npart of Django itself, and so are no longer separately maintained:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">boulder-oracle-sprint</code>: Added support for Oracle databases to\nDjango’s object-relational mapper. This has been part of Django\nsince the 1.0 release.</p></li>\n<li><p><code class=\"docutils literal notranslate\">gis</code>: Added support for geographic/spatial queries to Django’s\nobject-relational mapper. This has been part of Django since the 1.0\nrelease, as the bundled application <code class=\"docutils literal notranslate\">django.contrib.gis</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">i18n</code>: Added <a class=\"reference internal\" href=\"/fr/2.1/topics/i18n/\"><span class=\"doc\">internationalization support</span></a> to\nDjango. This has been part of Django since the 0.90 release.</p></li>\n<li><p><code class=\"docutils literal notranslate\">magic-removal</code>: A major refactoring of both the internals and\npublic APIs of Django’s object-relational mapper. This has been part\nof Django since the 0.95 release.</p></li>\n<li><p><code class=\"docutils literal notranslate\">multi-auth</code>: A refactoring of <a class=\"reference internal\" href=\"/fr/2.1/topics/auth/\"><span class=\"doc\">Django’s bundled\nauthentication framework</span></a> which added support for\n<a class=\"reference internal\" href=\"/fr/2.1/topics/auth/customizing/#authentication-backends\"><span class=\"std std-ref\">authentication backends</span></a>. This has\nbeen part of Django since the 0.95 release.</p></li>\n<li><p><code class=\"docutils literal notranslate\">new-admin</code>: A refactoring of <a class=\"reference internal\" href=\"/fr/2.1/ref/contrib/admin/\"><span class=\"doc\">Django’s bundled\nadministrative application</span></a>. This became part of\nDjango as of the 0.91 release, but was superseded by another\nrefactoring (see next listing) prior to the Django 1.0 release.</p></li>\n<li><p><code class=\"docutils literal notranslate\">newforms-admin</code>: The second refactoring of Django’s bundled\nadministrative application. This became part of Django as of the 1.0\nrelease, and is the basis of the current incarnation of\n<code class=\"docutils literal notranslate\">django.contrib.admin</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">queryset-refactor</code>: A refactoring of the internals of Django’s\nobject-relational mapper. This became part of Django as of the 1.0\nrelease.</p></li>\n<li><p><code class=\"docutils literal notranslate\">unicode</code>: A refactoring of Django’s internals to consistently use\nUnicode-based strings in most places within Django and Django\napplications. This became part of Django as of the 1.0 release.</p></li>\n</ul>\n<p>When Django moved from Subversion to Git, the information about branch merges\nwasn’t preserved in the source code repository. This means that the <code class=\"docutils literal notranslate\">master</code>\nbranch of Django doesn’t contain merge commits for the above branches.</p>\n<p>However, this information is <a class=\"reference external\" href=\"https://github.com/ramiro/django-git-grafts\">available as a grafts file</a>. You can restore it\nby putting the following lines in <code class=\"docutils literal notranslate\">.git/info/grafts</code> in your local clone:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>ac64e91a0cadc57f4bc5cd5d66955832320ca7a1 <span class=\"mi\">553</span>a20075e6991e7a60baee51ea68c8adc520d9a <span class=\"mi\">0</span>cb8e31823b2e9f05c4ae868c19f5f38e78a5f2e\n<span class=\"mf\">79e68</span>c225b926302ebb29c808dda8afa49856f5c d0f57e7c7385a112cb9e19d314352fc5ed5b0747 aa239e3e5405933af6a29dac3cf587b59a099927\n<span class=\"mi\">5</span>cf8f684237ab5addaf3549b2347c3adf107c0a7 cb45fd0ae20597306cd1f877efc99d9bd7cbee98 e27211a0deae2f1d402537f0ebb64ad4ccf6a4da\nf69cf70ed813a8cd7e1f963a14ae39103e8d5265 d5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 d2fcbcf9d76d5bb8a661ee73dae976c74183098b\naab3a418ac9293bb4abd7670f65d930cb0426d58 <span class=\"mi\">4</span>ea7a11659b8a0ab07b0d2e847975f7324664f10 adf4b9311d5d64a2bdd58da50271c121ea22e397\nff60c5f9de3e8690d1e86f3e9e3f7248a15397c8 <span class=\"mi\">7</span>ef212af149540aa2da577a960d0d87029fd1514 <span class=\"mi\">45</span>b4288bb66a3cda401b45901e85b645674c3988\n<span class=\"mi\">9</span>dda4abee1225db7a7b195b84c915fdd141a7260 <span class=\"mi\">4</span>fe5c9b7ee09dc25921918a6dbb7605edb374bc9 <span class=\"mi\">3</span>a7c14b583621272d4ef53061287b619ce3c290d\na19ed8aea395e8e07164ff7d85bd7dff2f24edca dc375fb0f3b7fbae740e8cfcd791b8bccb8a4e66 <span class=\"mi\">42</span>ea7a5ce8aece67d16c6610a49560c1493d4653\n<span class=\"mi\">9</span>c52d56f6f8a9cdafb231adf9f4110473099c9b5 c91a30f00fd182faf8ca5c03cd7dbcf8b735b458 <span class=\"mi\">4</span>a5c5c78f2ecd4ed8859cd5ac773ff3a01bccf96\n<span class=\"mi\">953</span>badbea5a04159adbfa970f5805c0232b6a401 <span class=\"mi\">4</span>c958b15b250866b70ded7d82aa532f1e57f96ae <span class=\"mi\">5664</span>a678b29ab04cad425c15b2792f4519f43928\n<span class=\"mi\">471596</span>fc1afcb9c6258d317c619eaf5fd394e797 <span class=\"mf\">4e89105</span>d64bb9e04c409139a41e9c7aac263df4c <span class=\"mf\">3e9035</span>a9625c8a8a5e88361133e87ce455c4fc13\n<span class=\"mi\">9233</span>d0426537615e06b78d28010d17d5a66adf44 <span class=\"mf\">6632739e94</span>c6c38b4c5a86cf5c80c48ae50ac49f <span class=\"mf\">18e151</span>bc3f8a85f2766d64262902a9fcad44d937\n</code></pre></div>\n<p>Additionally, the following branches are closed, but their code was\nnever merged into Django and the features they aimed to implement\nwere never finished:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">full-history</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">generic-auth</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">multiple-db-support</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">per-object-permissions</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">schema-evolution</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">schema-evolution-ng</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">search-api</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">sqlalchemy</code></p></li>\n</ul>\n<p>All of the above-mentioned branches now reside in <code class=\"docutils literal notranslate\">attic</code>.</p>\n<p>Finally, the repository contains <code class=\"docutils literal notranslate\">soc2009/xxx</code> and <code class=\"docutils literal notranslate\">soc2010/xxx</code> feature\nbranches, used for the 2009 and 2010 Google Summer of Code projects.</p>\n</section>\n</section>\n<section id=\"id1\">\n<h2>Balises<a class=\"heading-anchor\" href=\"#id1\"><span class=\"visually-hidden\">Lien vers cette rubrique</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Each Django release is tagged and signed by the releaser.</p>\n<p>The tags can be found on GitHub’s <a class=\"reference external\" href=\"https://github.com/django/django/tags\">tags</a> page.</p>\n</section>","rootId":"the-django-source-code-repository","toc":[{"title":"High-level overview","anchor":"high-level-overview","children":[]},{"title":"The master branch","anchor":"the-master-branch","children":[]},{"title":"Other branches","anchor":"other-branches","children":[{"title":"Les branches stables","anchor":"stable-branches","children":[]},{"title":"Feature-development branches","anchor":"feature-development-branches","children":[]}]},{"title":"Balises","anchor":"id1","children":[]}],"breadcrumbs":[{"docname":"internals/index","title":"Fonctionnement interne du projet Django","url":"/fr/2.1/internals/"}],"prev":{"docname":"internals/deprecation","title":"Calendrier d’obsolescence de Django","url":"/fr/2.1/internals/deprecation/"},"next":{"docname":"internals/howto-release-django","title":"Comment est constitué Django ?","url":"/fr/2.1/internals/howto-release-django/"},"formats":{"html":"/fr/2.1/internals/git/","markdown":"/fr/2.1/internals/git.md","json":"/fr/2.1/internals/git.json"},"source":"https://github.com/django/django/blob/stable/2.1.x/docs/internals/git.txt","official":"https://docs.djangoproject.com/fr/2.1/internals/git/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}