2012-06-07 16:48:29 +00:00
|
|
|
=================================
|
|
|
|
The Django source code repository
|
|
|
|
=================================
|
|
|
|
|
|
|
|
When deploying a Django application into a real production environment, you
|
|
|
|
will almost always want to use `an official packaged release of Django`_.
|
2012-06-08 09:26:22 +00:00
|
|
|
|
2012-06-07 16:48:29 +00:00
|
|
|
However, if you'd like to try out in-development code from an upcoming release
|
|
|
|
or contribute to the development of Django, you'll need to obtain a clone of
|
2012-06-08 09:26:22 +00:00
|
|
|
Django's source code repository.
|
|
|
|
|
|
|
|
This document covers the way the code repository is laid out and how to work
|
|
|
|
with and find things in it.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
.. _an official packaged release of Django: https://www.djangoproject.com/download/
|
|
|
|
|
|
|
|
High-level overview
|
|
|
|
===================
|
|
|
|
|
|
|
|
The Django source code repository uses `Git`_ to track changes to the code
|
|
|
|
over time, so you'll need a copy of the Git client (a program called ``git``)
|
|
|
|
on your computer, and you'll want to familiarize yourself with the basics of
|
2012-06-08 09:26:22 +00:00
|
|
|
how Git works.
|
|
|
|
|
2015-11-15 12:05:15 +00:00
|
|
|
Git's website offers downloads for various operating systems. The site also
|
2012-06-08 09:26:22 +00:00
|
|
|
contains vast amounts of `documentation`_.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
The Django Git repository is located online at `github.com/django/django
|
2012-06-08 09:26:22 +00:00
|
|
|
<https://github.com/django/django>`_. It contains the full source code for all
|
|
|
|
Django releases, which you can browse online.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
The Git repository includes several `branches`_:
|
|
|
|
|
|
|
|
* ``master`` contains the main in-development code which will become
|
|
|
|
the next packaged release of Django. This is where most development
|
|
|
|
activity is focused.
|
|
|
|
|
2013-05-22 14:22:32 +00:00
|
|
|
* ``stable/A.B.x`` are the branches where release preparation work happens.
|
2015-06-20 12:58:10 +00:00
|
|
|
They are also used for bugfix and security releases which occur as necessary
|
|
|
|
after the initial release of a feature version.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
2012-06-08 09:26:22 +00:00
|
|
|
The Git repository also contains `tags`_. These are the exact revisions from
|
|
|
|
which packaged Django releases were produced, since version 1.0.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
A number of tags also exist under the ``archive/`` prefix for :ref:`archived
|
|
|
|
work<archived-feature-development-work>`.
|
|
|
|
|
2016-01-10 17:16:28 +00:00
|
|
|
The source code for the `Djangoproject.com <https://www.djangoproject.com/>`_
|
|
|
|
website can be found at `github.com/django/djangoproject.com
|
2012-06-07 16:48:29 +00:00
|
|
|
<https://github.com/django/djangoproject.com>`_.
|
|
|
|
|
2017-05-20 15:51:21 +00:00
|
|
|
.. _Git: https://git-scm.com/
|
|
|
|
.. _documentation: https://git-scm.com/documentation
|
2012-06-07 16:48:29 +00:00
|
|
|
.. _branches: https://github.com/django/django/branches
|
|
|
|
.. _tags: https://github.com/django/django/tags
|
|
|
|
|
2012-06-08 09:26:22 +00:00
|
|
|
The master branch
|
|
|
|
=================
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
If you'd like to try out the in-development code for the next release of
|
|
|
|
Django, or if you'd like to contribute to Django by fixing bugs or developing
|
|
|
|
new features, you'll want to get the code from the master branch.
|
|
|
|
|
|
|
|
Note that this will get *all* of Django: in addition to the top-level
|
|
|
|
``django`` module containing Python code, you'll also get a copy of Django's
|
|
|
|
documentation, test suite, packaging scripts and other miscellaneous bits.
|
|
|
|
Django's code will be present in your clone as a directory named
|
|
|
|
``django``.
|
|
|
|
|
2019-06-17 14:54:55 +00:00
|
|
|
To try out the in-development code with your own applications, place the
|
|
|
|
directory containing your clone on your Python import path. Then ``import``
|
|
|
|
statements which look for Django will find the ``django`` module within your
|
|
|
|
clone.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
If you're going to be working on Django's code (say, to fix a bug or
|
|
|
|
develop a new feature), you can probably stop reading here and move
|
|
|
|
over to :doc:`the documentation for contributing to Django
|
|
|
|
</internals/contributing/index>`, which covers things like the preferred
|
|
|
|
coding style and how to generate and submit a patch.
|
|
|
|
|
2013-05-22 14:22:32 +00:00
|
|
|
Stable branches
|
2019-11-08 11:09:59 +00:00
|
|
|
===============
|
|
|
|
|
|
|
|
Django uses branches to prepare for releases of Django. Each major release
|
|
|
|
series has its own stable branch.
|
2013-05-22 14:22:32 +00:00
|
|
|
|
|
|
|
These branches can be found in the repository as ``stable/A.B.x``
|
|
|
|
branches and will be created right after the first alpha is tagged.
|
|
|
|
|
|
|
|
For example, immediately after *Django 1.5 alpha 1* was tagged, the branch
|
|
|
|
``stable/1.5.x`` was created and all further work on preparing the code for the
|
|
|
|
final 1.5 release was done there.
|
|
|
|
|
2018-01-31 18:04:19 +00:00
|
|
|
These branches also provide bugfix and security support as described in
|
|
|
|
:ref:`supported-versions-policy`.
|
2013-05-22 14:22:32 +00:00
|
|
|
|
|
|
|
For example, after the release of Django 1.5, the branch ``stable/1.5.x``
|
|
|
|
receives only fixes for security and critical stability bugs, which are
|
|
|
|
eventually released as Django 1.5.1 and so on, ``stable/1.4.x`` receives only
|
2018-01-31 18:04:19 +00:00
|
|
|
security and data loss fixes, and ``stable/1.3.x`` no longer receives any
|
|
|
|
updates.
|
2013-05-22 14:22:32 +00:00
|
|
|
|
|
|
|
.. admonition:: Historical information
|
|
|
|
|
|
|
|
This policy for handling ``stable/A.B.x`` branches was adopted starting
|
|
|
|
with the Django 1.5 release cycle.
|
|
|
|
|
|
|
|
Previously, these branches weren't created until right after the releases
|
|
|
|
and the stabilization work occurred on the main repository branch. Thus,
|
2018-01-31 18:04:19 +00:00
|
|
|
no new feature development work for the next release of Django could be
|
2013-05-22 14:22:32 +00:00
|
|
|
committed until the final release happened.
|
|
|
|
|
|
|
|
For example, shortly after the release of Django 1.3 the branch
|
|
|
|
``stable/1.3.x`` was created. Official support for that release has expired,
|
|
|
|
and so it no longer receives direct maintenance from the Django project.
|
2018-01-31 18:04:19 +00:00
|
|
|
However, that and all other similarly named branches continue to exist, and
|
2013-05-22 14:22:32 +00:00
|
|
|
interested community members have occasionally used them to provide
|
|
|
|
unofficial support for old Django releases.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
Tags
|
|
|
|
====
|
|
|
|
|
|
|
|
Each Django release is tagged and signed by the releaser.
|
|
|
|
|
|
|
|
The tags can be found on GitHub's `tags`_ page.
|
|
|
|
|
|
|
|
.. _tags: https://github.com/django/django/tags
|
|
|
|
|
|
|
|
.. _archived-feature-development-work:
|
|
|
|
|
|
|
|
Archived feature-development work
|
|
|
|
---------------------------------
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
.. admonition:: Historical information
|
|
|
|
|
|
|
|
Since Django moved to Git in 2012, anyone can clone the repository and
|
2013-11-25 03:05:59 +00:00
|
|
|
create their own branches, alleviating the need for official branches in
|
|
|
|
the source code repository.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
The following section is mostly useful if you're exploring the repository's
|
|
|
|
history, for example if you're trying to understand how some features were
|
|
|
|
designed.
|
|
|
|
|
|
|
|
Feature-development branches tend by their nature to be temporary. Some
|
|
|
|
produce successful features which are merged back into Django's master to
|
2018-01-31 18:04:19 +00:00
|
|
|
become part of an official release, but others do not; in either case, there
|
2012-06-07 16:48:29 +00:00
|
|
|
comes a time when the branch is no longer being actively worked on by any
|
|
|
|
developer. At this point the branch is considered closed.
|
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
Django used to be maintained with the Subversion revision control system, that
|
|
|
|
has no standard way of indicating this. As a workaround, branches of Django
|
|
|
|
which are closed and no longer maintained were moved into ``attic``.
|
|
|
|
|
|
|
|
A number of tags exist under the ``archive/`` prefix to maintain a reference to
|
|
|
|
this and other work of historical interest.
|
2012-06-07 16:48:29 +00:00
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
The following tags under the ``archive/attic/`` prefix reference the tip of
|
|
|
|
branches whose code eventually became part of Django itself:
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
* ``boulder-oracle-sprint``: Added support for Oracle databases to
|
|
|
|
Django's object-relational mapper. This has been part of Django
|
|
|
|
since the 1.0 release.
|
|
|
|
|
|
|
|
* ``gis``: Added support for geographic/spatial queries to Django's
|
|
|
|
object-relational mapper. This has been part of Django since the 1.0
|
|
|
|
release, as the bundled application ``django.contrib.gis``.
|
|
|
|
|
|
|
|
* ``i18n``: Added :doc:`internationalization support </topics/i18n/index>` to
|
|
|
|
Django. This has been part of Django since the 0.90 release.
|
|
|
|
|
|
|
|
* ``magic-removal``: A major refactoring of both the internals and
|
|
|
|
public APIs of Django's object-relational mapper. This has been part
|
|
|
|
of Django since the 0.95 release.
|
|
|
|
|
|
|
|
* ``multi-auth``: A refactoring of :doc:`Django's bundled
|
2012-12-28 19:00:11 +00:00
|
|
|
authentication framework </topics/auth/index>` which added support for
|
2012-06-07 16:48:29 +00:00
|
|
|
:ref:`authentication backends <authentication-backends>`. This has
|
|
|
|
been part of Django since the 0.95 release.
|
|
|
|
|
|
|
|
* ``new-admin``: A refactoring of :doc:`Django's bundled
|
|
|
|
administrative application </ref/contrib/admin/index>`. This became part of
|
|
|
|
Django as of the 0.91 release, but was superseded by another
|
|
|
|
refactoring (see next listing) prior to the Django 1.0 release.
|
|
|
|
|
|
|
|
* ``newforms-admin``: The second refactoring of Django's bundled
|
|
|
|
administrative application. This became part of Django as of the 1.0
|
|
|
|
release, and is the basis of the current incarnation of
|
|
|
|
``django.contrib.admin``.
|
|
|
|
|
|
|
|
* ``queryset-refactor``: A refactoring of the internals of Django's
|
|
|
|
object-relational mapper. This became part of Django as of the 1.0
|
|
|
|
release.
|
|
|
|
|
|
|
|
* ``unicode``: A refactoring of Django's internals to consistently use
|
|
|
|
Unicode-based strings in most places within Django and Django
|
|
|
|
applications. This became part of Django as of the 1.0 release.
|
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
Additionally, the following tags under the ``archive/attic/`` prefix reference
|
|
|
|
the tips of branches that were closed, but whose code was never merged into
|
|
|
|
Django, and the features they aimed to implement were never finished:
|
2012-06-07 16:48:29 +00:00
|
|
|
|
|
|
|
* ``full-history``
|
|
|
|
|
|
|
|
* ``generic-auth``
|
|
|
|
|
|
|
|
* ``multiple-db-support``
|
|
|
|
|
|
|
|
* ``per-object-permissions``
|
|
|
|
|
|
|
|
* ``schema-evolution``
|
|
|
|
|
|
|
|
* ``schema-evolution-ng``
|
|
|
|
|
|
|
|
* ``search-api``
|
|
|
|
|
|
|
|
* ``sqlalchemy``
|
|
|
|
|
2019-11-08 11:09:59 +00:00
|
|
|
Finally, under the ``archive/`` prefix, the repository contains
|
|
|
|
``soc20XX/<project>`` tags referencing the tip of branches that were used by
|
|
|
|
students who worked on Django during the 2009 and 2010 Google Summer of Code
|
|
|
|
programs.
|