Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 481c2de1450e70fa8fdc1e3abf72606b > files > 745

python-django-doc-1.11.20-1.mga7.noarch.rpm


<!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" lang="">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Writing your first patch for Django &#8212; Django 1.11.20 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" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></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>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Using Django" href="../topics/index.html" />
    <link rel="prev" title="What to read next" href="whatsnext.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.11.20 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">
    &laquo; <a href="whatsnext.html" title="What to read next">previous</a>
     |
    <a href="index.html" title="Getting started" accesskey="U">up</a>
   |
    <a href="../topics/index.html" title="Using Django">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="intro-contributing">
            
  <div class="section" id="s-writing-your-first-patch-for-django">
<span id="writing-your-first-patch-for-django"></span><h1>Writing your first patch for Django<a class="headerlink" href="#writing-your-first-patch-for-django" title="Permalink to this headline">¶</a></h1>
<div class="section" id="s-introduction">
<span id="introduction"></span><h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>Interested in giving back to the community a little? Maybe you’ve found a bug
in Django that you’d like to see fixed, or maybe there’s a small feature you
want added.</p>
<p>Contributing back to Django itself is the best way to see your own concerns
addressed. This may seem daunting at first, but it’s really pretty simple.
We’ll walk you through the entire process, so you can learn by example.</p>
<div class="section" id="s-who-s-this-tutorial-for">
<span id="who-s-this-tutorial-for"></span><h3>Who’s this tutorial for?<a class="headerlink" href="#who-s-this-tutorial-for" title="Permalink to this headline">¶</a></h3>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">If you are looking for a reference on how to submit patches, see the
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">Submitting patches</span></a>
documentation.</p>
</div>
<p>For this tutorial, we expect that you have at least a basic understanding of
how Django works. This means you should be comfortable going through the
existing tutorials on <a class="reference internal" href="tutorial01.html"><span class="doc">writing your first Django app</span></a>.
In addition, you should have a good understanding of Python itself. But if you
don’t, <a class="reference external" href="http://www.diveintopython3.net/">Dive Into Python</a> is a fantastic (and free) online book for
beginning Python programmers.</p>
<p>Those of you who are unfamiliar with version control systems and Trac will find
that this tutorial and its links include just enough information to get started.
However, you’ll probably want to read some more about these different tools if
you plan on contributing to Django regularly.</p>
<p>For the most part though, this tutorial tries to explain as much as possible,
so that it can be of use to the widest audience.</p>
<div class="admonition-where-to-get-help admonition">
<p class="first admonition-title">Where to get help:</p>
<p class="last">If you’re having trouble going through this tutorial, please post a message
to <a class="reference internal" href="../internals/mailing-lists.html#django-developers-mailing-list"><span class="std std-ref">django-developers</span></a> or drop by <a class="reference external" href="irc://irc.freenode.net/django-dev">#django-dev on irc.freenode.net</a> to
chat with other Django users who might be able to help.</p>
</div>
</div>
<div class="section" id="s-what-does-this-tutorial-cover">
<span id="what-does-this-tutorial-cover"></span><h3>What does this tutorial cover?<a class="headerlink" href="#what-does-this-tutorial-cover" title="Permalink to this headline">¶</a></h3>
<p>We’ll be walking you through contributing a patch to Django for the first time.
By the end of this tutorial, you should have a basic understanding of both the
tools and the processes involved. Specifically, we’ll be covering the following:</p>
<ul class="simple">
<li>Installing Git.</li>
<li>How to download a development copy of Django.</li>
<li>Running Django’s test suite.</li>
<li>Writing a test for your patch.</li>
<li>Writing the code for your patch.</li>
<li>Testing your patch.</li>
<li>Submitting a pull request.</li>
<li>Where to look for more information.</li>
</ul>
<p>Once you’re done with the tutorial, you can look through the rest of
<a class="reference internal" href="../internals/contributing/index.html"><span class="doc">Django’s documentation on contributing</span></a>.
It contains lots of great information and is a must read for anyone who’d like
to become a regular contributor to Django. If you’ve got questions, it’s
probably got the answers.</p>
<div class="admonition-python-3-required admonition">
<p class="first admonition-title">Python 3 required!</p>
<p class="last">This tutorial assumes you are using Python 3. Get the latest version at
<a class="reference external" href="https://www.python.org/downloads/">Python’s download page</a> or with your
operating system’s package manager.</p>
</div>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p class="last">When installing Python on Windows, make sure you check the option “Add
python.exe to Path”, so that it is always available on the command line.</p>
</div>
</div>
</div>
<div class="section" id="s-code-of-conduct">
<span id="code-of-conduct"></span><h2>Code of Conduct<a class="headerlink" href="#code-of-conduct" title="Permalink to this headline">¶</a></h2>
<p>As a contributor, you can help us keep the Django community open and inclusive.
Please read and follow our <a class="reference external" href="https://www.djangoproject.com/conduct/">Code of Conduct</a>.</p>
</div>
<div class="section" id="s-installing-git">
<span id="installing-git"></span><h2>Installing Git<a class="headerlink" href="#installing-git" title="Permalink to this headline">¶</a></h2>
<p>For this tutorial, you’ll need Git installed to download the current
development version of Django and to generate patch files for the changes you
make.</p>
<p>To check whether or not you have Git installed, enter <code class="docutils literal notranslate"><span class="pre">git</span></code> into the command
line. If you get messages saying that this command could not be found, you’ll
have to download and install it, see <a class="reference external" href="https://git-scm.com/download">Git’s download page</a>.</p>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p class="last">When installing Git on Windows, it is recommended that you pick the
“Git Bash” option so that Git runs in its own shell. This tutorial assumes
that’s how you have installed it.</p>
</div>
<p>If you’re not that familiar with Git, you can always find out more about its
commands (once it’s installed) by typing <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">help</span></code> into the command line.</p>
</div>
<div class="section" id="s-getting-a-copy-of-django-s-development-version">
<span id="getting-a-copy-of-django-s-development-version"></span><h2>Getting a copy of Django’s development version<a class="headerlink" href="#getting-a-copy-of-django-s-development-version" title="Permalink to this headline">¶</a></h2>
<p>The first step to contributing to Django is to get a copy of the source code.
First, <a class="reference external" href="https://github.com/django/django/fork">fork Django on GitHub</a>. Then,
from the command line, use the <code class="docutils literal notranslate"><span class="pre">cd</span></code> command to navigate to the directory
where you’ll want your local copy of Django to live.</p>
<p>Download the Django source code repository using the following command:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git clone git@github.com:YourGitHubName/django.git
</pre></div>
</div>
<p>Now that you have a local copy of Django, you can install it just like you would
install any package using <code class="docutils literal notranslate"><span class="pre">pip</span></code>. The most convenient way to do so is by using
a <em>virtual environment</em> (or virtualenv) which is a feature built into Python
that allows you to keep a separate directory of installed packages for each of
your projects so that they don’t interfere with each other.</p>
<p>It’s a good idea to keep all your virtualenvs in one place, for example in
<code class="docutils literal notranslate"><span class="pre">.virtualenvs/</span></code> in your home directory. Create it if it doesn’t exist yet:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> mkdir ~/.virtualenvs
</pre></div>
</div>
<p>Now create a new virtualenv by running:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> python3 -m venv ~/.virtualenvs/djangodev
</pre></div>
</div>
<p>The path is where the new environment will be saved on your computer.</p>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p>Using the built-in <code class="docutils literal notranslate"><span class="pre">venv</span></code> module will not work if you are also using the
Git Bash shell on Windows, since activation scripts are only created for the
system shell (<code class="docutils literal notranslate"><span class="pre">.bat</span></code>) and PowerShell (<code class="docutils literal notranslate"><span class="pre">.ps1</span></code>). Use the <code class="docutils literal notranslate"><span class="pre">virtualenv</span></code>
package instead:</p>
<div class="last highlight-none notranslate"><div class="highlight"><pre><span></span>$ pip install virtualenv
$ virtualenv ~/.virtualenvs/djangodev
</pre></div>
</div>
</div>
<div class="admonition-for-ubuntu-users admonition">
<p class="first admonition-title">For Ubuntu users</p>
<p>On some versions of Ubuntu the above command might fail. Use the
<code class="docutils literal notranslate"><span class="pre">virtualenv</span></code> package instead, first making sure you have <code class="docutils literal notranslate"><span class="pre">pip3</span></code>:</p>
<div class="last highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> sudo apt-get install python3-pip
<span class="gp">$</span> <span class="c1"># Prefix the next command with sudo if it gives a permission denied error</span>
<span class="gp">$</span> pip3 install virtualenv
<span class="gp">$</span> virtualenv --python<span class="o">=</span><span class="sb">`</span>which python3<span class="sb">`</span> ~/.virtualenvs/djangodev
</pre></div>
</div>
</div>
<p>The final step in setting up your virtualenv is to activate it:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> <span class="nb">source</span> ~/.virtualenvs/djangodev/bin/activate
</pre></div>
</div>
<p>If the <code class="docutils literal notranslate"><span class="pre">source</span></code> command is not available, you can try using a dot instead:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> . ~/.virtualenvs/djangodev/bin/activate
</pre></div>
</div>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p>To activate your virtualenv on Windows, run:</p>
<div class="last highlight-none notranslate"><div class="highlight"><pre><span></span>$ source ~/virtualenvs/djangodev/Scripts/activate
</pre></div>
</div>
</div>
<p>You have to activate the virtualenv whenever you open a new terminal window.
<a class="reference external" href="https://virtualenvwrapper.readthedocs.io/en/latest/">virtualenvwrapper</a> is a useful tool for making this more convenient.</p>
<p>Anything you install through <code class="docutils literal notranslate"><span class="pre">pip</span></code> from now on will be installed in your new
virtualenv, isolated from other environments and system-wide packages. Also, the
name of the currently activated virtualenv is displayed on the command line to
help you keep track of which one you are using. Go ahead and install the
previously cloned copy of Django:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pip install -e /path/to/your/local/clone/django/
</pre></div>
</div>
<p>The installed version of Django is now pointing at your local copy. You will
immediately see any changes you make to it, which is of great help when writing
your first patch.</p>
</div>
<div class="section" id="s-rolling-back-to-a-previous-revision-of-django">
<span id="rolling-back-to-a-previous-revision-of-django"></span><h2>Rolling back to a previous revision of Django<a class="headerlink" href="#rolling-back-to-a-previous-revision-of-django" title="Permalink to this headline">¶</a></h2>
<p>For this tutorial, we’ll be using ticket <a class="reference external" href="https://code.djangoproject.com/ticket/24788">#24788</a> as a case study, so
we’ll rewind Django’s version history in git to before that ticket’s patch was
applied. This will allow us to go through all of the steps involved in writing
that patch from scratch, including running Django’s test suite.</p>
<p><strong>Keep in mind that while we’ll be using an older revision of Django’s trunk
for the purposes of the tutorial below, you should always use the current
development revision of Django when working on your own patch for a ticket!</strong></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The patch for this ticket was written by Paweł Marczewski, and it was
applied to Django as <a class="reference external" href="https://github.com/django/django/commit/4df7e8483b2679fc1cba3410f08960bac6f51115">commit 4df7e8483b2679fc1cba3410f08960bac6f51115</a>.
Consequently, we’ll be using the revision of Django just prior to that,
<a class="reference external" href="https://github.com/django/django/commit/4ccfc4439a7add24f8db4ef3960d02ef8ae09887">commit 4ccfc4439a7add24f8db4ef3960d02ef8ae09887</a>.</p>
</div>
<p>Navigate into Django’s root directory (that’s the one that contains <code class="docutils literal notranslate"><span class="pre">django</span></code>,
<code class="docutils literal notranslate"><span class="pre">docs</span></code>, <code class="docutils literal notranslate"><span class="pre">tests</span></code>, <code class="docutils literal notranslate"><span class="pre">AUTHORS</span></code>, etc.). You can then check out the older
revision of Django that we’ll be using in the tutorial below:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout 4ccfc4439a7add24f8db4ef3960d02ef8ae09887
</pre></div>
</div>
</div>
<div class="section" id="s-running-django-s-test-suite-for-the-first-time">
<span id="running-django-s-test-suite-for-the-first-time"></span><h2>Running Django’s test suite for the first time<a class="headerlink" href="#running-django-s-test-suite-for-the-first-time" title="Permalink to this headline">¶</a></h2>
<p>When contributing to Django it’s very important that your code changes don’t
introduce bugs into other areas of Django. One way to check that Django still
works after you make your changes is by running Django’s test suite. If all
the tests still pass, then you can be reasonably sure that your changes
haven’t completely broken Django. If you’ve never run Django’s test suite
before, it’s a good idea to run it once beforehand just to get familiar with
what its output is supposed to look like.</p>
<p>Before running the test suite, install its dependencies by first <code class="docutils literal notranslate"><span class="pre">cd</span></code>-ing
into the Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and then running:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pip install -r requirements/py3.txt
</pre></div>
</div>
<p>If you encounter an error during the installation, your system might be missing
a dependency for one or more of the Python packages. Consult the failing
package’s documentation or search the Web with the error message that you
encounter.</p>
<p>Now we are ready to run the test suite. If you’re using GNU/Linux, macOS, or
some other flavor of Unix, run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py
</pre></div>
</div>
<p>Now sit back and relax. Django’s entire test suite has over 9,600 different
tests, so it can take anywhere from 5 to 15 minutes to run, depending on the
speed of your computer.</p>
<p>While Django’s test suite is running, you’ll see a stream of characters
representing the status of each test as it’s run. <code class="docutils literal notranslate"><span class="pre">E</span></code> indicates that an error
was raised during a test, and <code class="docutils literal notranslate"><span class="pre">F</span></code> indicates that a test’s assertions failed.
Both of these are considered to be test failures. Meanwhile, <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code>
indicated expected failures and skipped tests, respectively. Dots indicate
passing tests.</p>
<p>Skipped tests are typically due to missing external libraries required to run
the test; see <a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-dependencies"><span class="std std-ref">Running all the tests</span></a> for a list of dependencies
and be sure to install any for tests related to the changes you are making (we
won’t need any for this tutorial). Some tests are specific to a particular
database backend and will be skipped if not testing with that backend. SQLite
is the database backend for the default settings. To run the tests using a
different backend, see <a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-settings"><span class="std std-ref">Using another settings module</span></a>.</p>
<p>Once the tests complete, you should be greeted with a message informing you
whether the test suite passed or failed. Since you haven’t yet made any changes
to Django’s code, the entire test suite <strong>should</strong> pass. If you get failures or
errors make sure you’ve followed all of the previous steps properly. See
<a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests"><span class="std std-ref">Running the unit tests</span></a> for more information. If you’re using Python 3.5+,
there will be a couple failures related to deprecation warnings that you can
ignore. These failures have since been fixed in Django.</p>
<p>Note that the latest Django trunk may not always be stable. When developing
against trunk, you can check <a class="reference external" href="https://djangoci.com">Django’s continuous integration builds</a> to
determine if the failures are specific to your machine or if they are also
present in Django’s official builds. If you click to view a particular build,
you can view the “Configuration Matrix” which shows failures broken down by
Python version and database backend.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For this tutorial and the ticket we’re working on, testing against SQLite
is sufficient, however, it’s possible (and sometimes necessary) to
<a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-settings"><span class="std std-ref">run the tests using a different database</span></a>.</p>
</div>
</div>
<div class="section" id="s-creating-a-branch-for-your-patch">
<span id="creating-a-branch-for-your-patch"></span><h2>Creating a branch for your patch<a class="headerlink" href="#creating-a-branch-for-your-patch" title="Permalink to this headline">¶</a></h2>
<p>Before making any changes, create a new branch for the ticket:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout -b ticket_24788
</pre></div>
</div>
<p>You can choose any name that you want for the branch, “ticket_24788” is an
example. All changes made in this branch will be specific to the ticket and
won’t affect the main copy of the code that we cloned earlier.</p>
</div>
<div class="section" id="s-writing-some-tests-for-your-ticket">
<span id="writing-some-tests-for-your-ticket"></span><h2>Writing some tests for your ticket<a class="headerlink" href="#writing-some-tests-for-your-ticket" title="Permalink to this headline">¶</a></h2>
<p>In most cases, for a patch to be accepted into Django it has to include tests.
For bug fix patches, this means writing a regression test to ensure that the
bug is never reintroduced into Django later on. A regression test should be
written in such a way that it will fail while the bug still exists and pass
once the bug has been fixed. For patches containing new features, you’ll need
to include tests which ensure that the new features are working correctly.
They too should fail when the new feature is not present, and then pass once it
has been implemented.</p>
<p>A good way to do this is to write your new tests first, before making any
changes to the code. This style of development is called
<a class="reference external" href="https://en.wikipedia.org/wiki/Test-driven_development">test-driven development</a> and can be applied to both entire projects and
single patches. After writing your tests, you then run them to make sure that
they do indeed fail (since you haven’t fixed that bug or added that feature
yet). If your new tests don’t fail, you’ll need to fix them so that they do.
After all, a regression test that passes regardless of whether a bug is present
is not very helpful at preventing that bug from reoccurring down the road.</p>
<p>Now for our hands-on example.</p>
<div class="section" id="s-writing-some-tests-for-ticket-24788">
<span id="writing-some-tests-for-ticket-24788"></span><h3>Writing some tests for ticket #24788<a class="headerlink" href="#writing-some-tests-for-ticket-24788" title="Permalink to this headline">¶</a></h3>
<p>Ticket <a class="reference external" href="https://code.djangoproject.com/ticket/24788">#24788</a> proposes a small feature addition: the ability to
specify the class level attribute <code class="docutils literal notranslate"><span class="pre">prefix</span></code> on Form classes, so that:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[…] forms which ship with apps could effectively namespace themselves such
that N overlapping form fields could be POSTed at once and resolved to the
correct form.
</pre></div>
</div>
<p>In order to resolve this ticket, we’ll add a <code class="docutils literal notranslate"><span class="pre">prefix</span></code> attribute to the
<code class="docutils literal notranslate"><span class="pre">BaseForm</span></code> class. When creating instances of this class, passing a prefix to
the <code class="docutils literal notranslate"><span class="pre">__init__()</span></code> method will still set that prefix on the created instance.
But not passing a prefix (or passing <code class="docutils literal notranslate"><span class="pre">None</span></code>) will use the class-level prefix.
Before we make those changes though, we’re going to write a couple tests to
verify that our modification functions correctly and continues to function
correctly in the future.</p>
<p>Navigate to Django’s <code class="docutils literal notranslate"><span class="pre">tests/forms_tests/tests/</span></code> folder and open the
<code class="docutils literal notranslate"><span class="pre">test_forms.py</span></code> file. Add the following code on line 1674 right before the
<code class="docutils literal notranslate"><span class="pre">test_forms_with_null_boolean</span></code> function:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">test_class_prefix</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    <span class="c1"># Prefix can be also specified at the class level.</span>
    <span class="k">class</span> <span class="nc">Person</span><span class="p">(</span><span class="n">Form</span><span class="p">):</span>
        <span class="n">first_name</span> <span class="o">=</span> <span class="n">CharField</span><span class="p">()</span>
        <span class="n">prefix</span> <span class="o">=</span> <span class="s1">&#39;foo&#39;</span>

    <span class="n">p</span> <span class="o">=</span> <span class="n">Person</span><span class="p">()</span>
    <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">prefix</span><span class="p">,</span> <span class="s1">&#39;foo&#39;</span><span class="p">)</span>

    <span class="n">p</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s1">&#39;bar&#39;</span><span class="p">)</span>
    <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">prefix</span><span class="p">,</span> <span class="s1">&#39;bar&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>This new test checks that setting a class level prefix works as expected, and
that passing a <code class="docutils literal notranslate"><span class="pre">prefix</span></code> parameter when creating an instance still works too.</p>
<div class="admonition-but-this-testing-thing-looks-kinda-hard admonition">
<p class="first admonition-title">But this testing thing looks kinda hard…</p>
<p>If you’ve never had to deal with tests before, they can look a little hard
to write at first glance. Fortunately, testing is a <em>very</em> big subject in
computer programming, so there’s lots of information out there:</p>
<ul class="last simple">
<li>A good first look at writing tests for Django can be found in the
documentation on <a class="reference internal" href="../topics/testing/overview.html"><span class="doc">Writing and running tests</span></a>.</li>
<li>Dive Into Python (a free online book for beginning Python developers)
includes a great <a class="reference external" href="http://www.diveintopython3.net/unit-testing.html">introduction to Unit Testing</a>.</li>
<li>After reading those, if you want something a little meatier to sink
your teeth into, there’s always the Python <code class="xref py py-mod docutils literal notranslate"><span class="pre">unittest</span></code> documentation.</li>
</ul>
</div>
</div>
<div class="section" id="s-running-your-new-test">
<span id="running-your-new-test"></span><h3>Running your new test<a class="headerlink" href="#running-your-new-test" title="Permalink to this headline">¶</a></h3>
<p>Remember that we haven’t actually made any modifications to <code class="docutils literal notranslate"><span class="pre">BaseForm</span></code> yet,
so our tests are going to fail. Let’s run all the tests in the <code class="docutils literal notranslate"><span class="pre">forms_tests</span></code>
folder to make sure that’s really what happens. From the command line, <code class="docutils literal notranslate"><span class="pre">cd</span></code>
into the Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py forms_tests
</pre></div>
</div>
<p>If the tests ran correctly, you should see one failure corresponding to the test
method we added. If all of the tests passed, then you’ll want to make sure that
you added the new test shown above to the appropriate folder and class.</p>
</div>
</div>
<div class="section" id="s-writing-the-code-for-your-ticket">
<span id="writing-the-code-for-your-ticket"></span><h2>Writing the code for your ticket<a class="headerlink" href="#writing-the-code-for-your-ticket" title="Permalink to this headline">¶</a></h2>
<p>Next we’ll be adding the functionality described in ticket <a class="reference external" href="https://code.djangoproject.com/ticket/24788">#24788</a> to
Django.</p>
<div class="section" id="s-writing-the-code-for-ticket-24788">
<span id="writing-the-code-for-ticket-24788"></span><h3>Writing the code for ticket #24788<a class="headerlink" href="#writing-the-code-for-ticket-24788" title="Permalink to this headline">¶</a></h3>
<p>Navigate to the <code class="docutils literal notranslate"><span class="pre">django/django/forms/</span></code> folder and open the <code class="docutils literal notranslate"><span class="pre">forms.py</span></code> file.
Find the <code class="docutils literal notranslate"><span class="pre">BaseForm</span></code> class on line 72 and add the <code class="docutils literal notranslate"><span class="pre">prefix</span></code> class attribute
right after the <code class="docutils literal notranslate"><span class="pre">field_order</span></code> attribute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">BaseForm</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
    <span class="c1"># This is the main implementation of all the Form logic. Note that this</span>
    <span class="c1"># class is different than Form. See the comments by the Form class for</span>
    <span class="c1"># more information. Any improvements to the form API should be made to</span>
    <span class="c1"># *this* class, not to the Form class.</span>
    <span class="n">field_order</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">prefix</span> <span class="o">=</span> <span class="kc">None</span>
</pre></div>
</div>
</div>
<div class="section" id="s-verifying-your-test-now-passes">
<span id="verifying-your-test-now-passes"></span><h3>Verifying your test now passes<a class="headerlink" href="#verifying-your-test-now-passes" title="Permalink to this headline">¶</a></h3>
<p>Once you’re done modifying Django, we need to make sure that the tests we wrote
earlier pass, so we can see whether the code we wrote above is working
correctly. To run the tests in the <code class="docutils literal notranslate"><span class="pre">forms_tests</span></code> folder, <code class="docutils literal notranslate"><span class="pre">cd</span></code> into the
Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py forms_tests
</pre></div>
</div>
<p>Oops, good thing we wrote those tests! You should still see one failure with
the following exception:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ne">AssertionError</span><span class="p">:</span> <span class="kc">None</span> <span class="o">!=</span> <span class="s1">&#39;foo&#39;</span>
</pre></div>
</div>
<p>We forgot to add the conditional statement in the <code class="docutils literal notranslate"><span class="pre">__init__</span></code> method. Go ahead
and change <code class="docutils literal notranslate"><span class="pre">self.prefix</span> <span class="pre">=</span> <span class="pre">prefix</span></code> that is now on line 87 of
<code class="docutils literal notranslate"><span class="pre">django/forms/forms.py</span></code>, adding a conditional statement:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="n">prefix</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
    <span class="bp">self</span><span class="o">.</span><span class="n">prefix</span> <span class="o">=</span> <span class="n">prefix</span>
</pre></div>
</div>
<p>Re-run the tests and everything should pass. If it doesn’t, make sure you
correctly modified the <code class="docutils literal notranslate"><span class="pre">BaseForm</span></code> class as shown above and copied the new test
correctly.</p>
</div>
</div>
<div class="section" id="s-running-django-s-test-suite-for-the-second-time">
<span id="running-django-s-test-suite-for-the-second-time"></span><h2>Running Django’s test suite for the second time<a class="headerlink" href="#running-django-s-test-suite-for-the-second-time" title="Permalink to this headline">¶</a></h2>
<p>Once you’ve verified that your patch and your test are working correctly, it’s
a good idea to run the entire Django test suite just to verify that your change
hasn’t introduced any bugs into other areas of Django. While successfully
passing the entire test suite doesn’t guarantee your code is bug free, it does
help identify many bugs and regressions that might otherwise go unnoticed.</p>
<p>To run the entire Django test suite, <code class="docutils literal notranslate"><span class="pre">cd</span></code> into the Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code>
directory and run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py
</pre></div>
</div>
<p>As long as you don’t see any failures, you’re good to go.</p>
</div>
<div class="section" id="s-writing-documentation">
<span id="writing-documentation"></span><h2>Writing Documentation<a class="headerlink" href="#writing-documentation" title="Permalink to this headline">¶</a></h2>
<p>This is a new feature, so it should be documented. Add the following section on
line 1068 (at the end of the file) of <code class="docutils literal notranslate"><span class="pre">django/docs/ref/forms/api.txt</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>The prefix can also be specified on the form class::

    &gt;&gt;&gt; class PersonForm(forms.Form):
    ...     ...
    ...     prefix = &#39;person&#39;

.. versionadded:: 1.9

    The ability to specify ``prefix`` on the form class was added.
</pre></div>
</div>
<p>Since this new feature will be in an upcoming release it is also added to the
release notes for Django 1.9, on line 164 under the “Forms” section in the file
<code class="docutils literal notranslate"><span class="pre">docs/releases/1.9.txt</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>* A form prefix can be specified inside a form class, not only when
  instantiating a form. See :ref:`form-prefix` for details.
</pre></div>
</div>
<p>For more information on writing documentation, including an explanation of what
the <code class="docutils literal notranslate"><span class="pre">versionadded</span></code> bit is all about, see
<a class="reference internal" href="../internals/contributing/writing-documentation.html"><span class="doc">Writing documentation</span></a>. That page also includes
an explanation of how to build a copy of the documentation locally, so you can
preview the HTML that will be generated.</p>
</div>
<div class="section" id="s-previewing-your-changes">
<span id="previewing-your-changes"></span><h2>Previewing your changes<a class="headerlink" href="#previewing-your-changes" title="Permalink to this headline">¶</a></h2>
<p>Now it’s time to go through all the changes made in our patch. To display the
differences between your current copy of Django (with your changes) and the
revision that you initially checked out earlier in the tutorial:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git diff
</pre></div>
</div>
<p>Use the arrow keys to move up and down.</p>
<div class="highlight-diff notranslate"><div class="highlight"><pre><span></span><span class="gh">diff --git a/django/forms/forms.py b/django/forms/forms.py</span>
<span class="gh">index 509709f..d1370de 100644</span>
<span class="gd">--- a/django/forms/forms.py</span>
<span class="gi">+++ b/django/forms/forms.py</span>
<span class="gu">@@ -75,6 +75,7 @@ class BaseForm(object):</span>
     # information. Any improvements to the form API should be made to *this*
     # class, not to the Form class.
     field_order = None
<span class="gi">+    prefix = None</span>

     def __init__(self, data=None, files=None, auto_id=&#39;id_%s&#39;, prefix=None,
                  initial=None, error_class=ErrorList, label_suffix=None,
<span class="gu">@@ -83,7 +84,8 @@ class BaseForm(object):</span>
         self.data = data or {}
         self.files = files or {}
         self.auto_id = auto_id
<span class="gd">-        self.prefix = prefix</span>
<span class="gi">+        if prefix is not None:</span>
<span class="gi">+            self.prefix = prefix</span>
         self.initial = initial or {}
         self.error_class = error_class
         # Translators: This is the default suffix added to form field labels
<span class="gh">diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt</span>
<span class="gh">index 3bc39cd..008170d 100644</span>
<span class="gd">--- a/docs/ref/forms/api.txt</span>
<span class="gi">+++ b/docs/ref/forms/api.txt</span>
<span class="gu">@@ -1065,3 +1065,13 @@ You can put several Django forms inside one ``&lt;form&gt;`` tag. To give each</span>
     &gt;&gt;&gt; print(father.as_ul())
     &lt;li&gt;&lt;label for=&quot;id_father-first_name&quot;&gt;First name:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;father-first_name&quot; id=&quot;id_father-first_name&quot; /&gt;&lt;/li&gt;
     &lt;li&gt;&lt;label for=&quot;id_father-last_name&quot;&gt;Last name:&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;father-last_name&quot; id=&quot;id_father-last_name&quot; /&gt;&lt;/li&gt;
<span class="gi">+</span>
<span class="gi">+The prefix can also be specified on the form class::</span>
<span class="gi">+</span>
<span class="gi">+    &gt;&gt;&gt; class PersonForm(forms.Form):</span>
<span class="gi">+    ...     ...</span>
<span class="gi">+    ...     prefix = &#39;person&#39;</span>
<span class="gi">+</span>
<span class="gi">+.. versionadded:: 1.9</span>
<span class="gi">+</span>
<span class="gi">+    The ability to specify ``prefix`` on the form class was added.</span>
<span class="gh">diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt</span>
<span class="gh">index 5b58f79..f9bb9de 100644</span>
<span class="gd">--- a/docs/releases/1.9.txt</span>
<span class="gi">+++ b/docs/releases/1.9.txt</span>
<span class="gu">@@ -161,6 +161,9 @@ Forms</span>
   :attr:`~django.forms.Form.field_order` attribute, the ``field_order``
   constructor argument , or the :meth:`~django.forms.Form.order_fields` method.

<span class="gi">+* A form prefix can be specified inside a form class, not only when</span>
<span class="gi">+  instantiating a form. See :ref:`form-prefix` for details.</span>
<span class="gi">+</span>
 Generic Views
 ^^^^^^^^^^^^^

<span class="gh">diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py</span>
<span class="gh">index 690f205..e07fae2 100644</span>
<span class="gd">--- a/tests/forms_tests/tests/test_forms.py</span>
<span class="gi">+++ b/tests/forms_tests/tests/test_forms.py</span>
<span class="gu">@@ -1671,6 +1671,18 @@ class FormsTestCase(SimpleTestCase):</span>
         self.assertEqual(p.cleaned_data[&#39;last_name&#39;], &#39;Lennon&#39;)
         self.assertEqual(p.cleaned_data[&#39;birthday&#39;], datetime.date(1940, 10, 9))

<span class="gi">+    def test_class_prefix(self):</span>
<span class="gi">+        # Prefix can be also specified at the class level.</span>
<span class="gi">+        class Person(Form):</span>
<span class="gi">+            first_name = CharField()</span>
<span class="gi">+            prefix = &#39;foo&#39;</span>
<span class="gi">+</span>
<span class="gi">+        p = Person()</span>
<span class="gi">+        self.assertEqual(p.prefix, &#39;foo&#39;)</span>
<span class="gi">+</span>
<span class="gi">+        p = Person(prefix=&#39;bar&#39;)</span>
<span class="gi">+        self.assertEqual(p.prefix, &#39;bar&#39;)</span>
<span class="gi">+</span>
     def test_forms_with_null_boolean(self):
         # NullBooleanField is a bit of a special case because its presentation (widget)
         # is different than its data. This is handled transparently, though.
</pre></div>
</div>
<p>When you’re done previewing the patch, hit the <code class="docutils literal notranslate"><span class="pre">q</span></code> key to return to the
command line. If the patch’s content looked okay, it’s time to commit the
changes.</p>
</div>
<div class="section" id="s-committing-the-changes-in-the-patch">
<span id="committing-the-changes-in-the-patch"></span><h2>Committing the changes in the patch<a class="headerlink" href="#committing-the-changes-in-the-patch" title="Permalink to this headline">¶</a></h2>
<p>To commit the changes:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git commit -a
</pre></div>
</div>
<p>This opens up a text editor to type the commit message. Follow the <a class="reference internal" href="../internals/contributing/committing-code.html#committing-guidelines"><span class="std std-ref">commit
message guidelines</span></a> and write a message like:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Fixed #24788 -- Allowed Forms to specify a prefix at the class level.
</pre></div>
</div>
</div>
<div class="section" id="s-pushing-the-commit-and-making-a-pull-request">
<span id="pushing-the-commit-and-making-a-pull-request"></span><h2>Pushing the commit and making a pull request<a class="headerlink" href="#pushing-the-commit-and-making-a-pull-request" title="Permalink to this headline">¶</a></h2>
<p>After committing the patch, send it to your fork on GitHub (substitute
“ticket_24788” with the name of your branch if it’s different):</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git push origin ticket_24788
</pre></div>
</div>
<p>You can create a pull request by visiting the <a class="reference external" href="https://github.com/django/django/">Django GitHub page</a>. You’ll see your branch under “Your
recently pushed branches”. Click “Compare &amp; pull request” next to it.</p>
<p>Please don’t do it for this tutorial, but on the next page that displays a
preview of the patch, you would click “Create pull request”.</p>
</div>
<div class="section" id="s-next-steps">
<span id="next-steps"></span><h2>Next steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2>
<p>Congratulations, you’ve learned how to make a pull request to Django! Details
of more advanced techniques you may need are in
<a class="reference internal" href="../internals/contributing/writing-code/working-with-git.html"><span class="doc">Working with Git and GitHub</span></a>.</p>
<p>Now you can put those skills to good use by helping to improve Django’s
codebase.</p>
<div class="section" id="s-more-information-for-new-contributors">
<span id="more-information-for-new-contributors"></span><h3>More information for new contributors<a class="headerlink" href="#more-information-for-new-contributors" title="Permalink to this headline">¶</a></h3>
<p>Before you get too into writing patches for Django, there’s a little more
information on contributing that you should probably take a look at:</p>
<ul class="simple">
<li>You should make sure to read Django’s documentation on
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">claiming tickets and submitting patches</span></a>.
It covers Trac etiquette, how to claim tickets for yourself, expected
coding style for patches, and many other important details.</li>
<li>First time contributors should also read Django’s <a class="reference internal" href="../internals/contributing/new-contributors.html"><span class="doc">documentation
for first time contributors</span></a>.
It has lots of good advice for those of us who are new to helping out
with Django.</li>
<li>After those, if you’re still hungry for more information about
contributing, you can always browse through the rest of
<a class="reference internal" href="../internals/contributing/index.html"><span class="doc">Django’s documentation on contributing</span></a>.
It contains a ton of useful information and should be your first source
for answering any questions you might have.</li>
</ul>
</div>
<div class="section" id="s-finding-your-first-real-ticket">
<span id="finding-your-first-real-ticket"></span><h3>Finding your first real ticket<a class="headerlink" href="#finding-your-first-real-ticket" title="Permalink to this headline">¶</a></h3>
<p>Once you’ve looked through some of that information, you’ll be ready to go out
and find a ticket of your own to write a patch for. Pay special attention to
tickets with the “easy pickings” criterion. These tickets are often much
simpler in nature and are great for first time contributors. Once you’re
familiar with contributing to Django, you can move on to writing patches for
more difficult and complicated tickets.</p>
<p>If you just want to get started already (and nobody would blame you!), try
taking a look at the list of <a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;has_patch=0&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that need patches</a> and the
<a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_better_patch=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that have patches which need improvement</a>. If you’re familiar
with writing tests, you can also look at the list of
<a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_tests=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that need tests</a>. Just remember to follow the guidelines about
claiming tickets that were mentioned in the link to Django’s documentation on
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">claiming tickets and submitting patches</span></a>.</p>
</div>
<div class="section" id="s-what-s-next-after-creating-a-pull-request">
<span id="what-s-next-after-creating-a-pull-request"></span><h3>What’s next after creating a pull request?<a class="headerlink" href="#what-s-next-after-creating-a-pull-request" title="Permalink to this headline">¶</a></h3>
<p>After a ticket has a patch, it needs to be reviewed by a second set of eyes.
After submitting a pull request, update the ticket metadata by setting the
flags on the ticket to say “has patch”, “doesn’t need tests”, etc, so others
can find it for review. Contributing doesn’t necessarily always mean writing a
patch from scratch. Reviewing existing patches is also a very helpful
contribution. See <a class="reference internal" href="../internals/contributing/triaging-tickets.html"><span class="doc">Triaging tickets</span></a> for details.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Writing your first patch for Django</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a><ul>
<li><a class="reference internal" href="#who-s-this-tutorial-for">Who’s this tutorial for?</a></li>
<li><a class="reference internal" href="#what-does-this-tutorial-cover">What does this tutorial cover?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#code-of-conduct">Code of Conduct</a></li>
<li><a class="reference internal" href="#installing-git">Installing Git</a></li>
<li><a class="reference internal" href="#getting-a-copy-of-django-s-development-version">Getting a copy of Django’s development version</a></li>
<li><a class="reference internal" href="#rolling-back-to-a-previous-revision-of-django">Rolling back to a previous revision of Django</a></li>
<li><a class="reference internal" href="#running-django-s-test-suite-for-the-first-time">Running Django’s test suite for the first time</a></li>
<li><a class="reference internal" href="#creating-a-branch-for-your-patch">Creating a branch for your patch</a></li>
<li><a class="reference internal" href="#writing-some-tests-for-your-ticket">Writing some tests for your ticket</a><ul>
<li><a class="reference internal" href="#writing-some-tests-for-ticket-24788">Writing some tests for ticket #24788</a></li>
<li><a class="reference internal" href="#running-your-new-test">Running your new test</a></li>
</ul>
</li>
<li><a class="reference internal" href="#writing-the-code-for-your-ticket">Writing the code for your ticket</a><ul>
<li><a class="reference internal" href="#writing-the-code-for-ticket-24788">Writing the code for ticket #24788</a></li>
<li><a class="reference internal" href="#verifying-your-test-now-passes">Verifying your test now passes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-django-s-test-suite-for-the-second-time">Running Django’s test suite for the second time</a></li>
<li><a class="reference internal" href="#writing-documentation">Writing Documentation</a></li>
<li><a class="reference internal" href="#previewing-your-changes">Previewing your changes</a></li>
<li><a class="reference internal" href="#committing-the-changes-in-the-patch">Committing the changes in the patch</a></li>
<li><a class="reference internal" href="#pushing-the-commit-and-making-a-pull-request">Pushing the commit and making a pull request</a></li>
<li><a class="reference internal" href="#next-steps">Next steps</a><ul>
<li><a class="reference internal" href="#more-information-for-new-contributors">More information for new contributors</a></li>
<li><a class="reference internal" href="#finding-your-first-real-ticket">Finding your first real ticket</a></li>
<li><a class="reference internal" href="#what-s-next-after-creating-a-pull-request">What’s next after creating a pull request?</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="whatsnext.html"
                        title="previous chapter">What to read next</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../topics/index.html"
                        title="next chapter">Using Django</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/intro/contributing.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <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>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Feb 11, 2019</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="whatsnext.html" title="What to read next">previous</a>
     |
    <a href="index.html" title="Getting started" accesskey="U">up</a>
   |
    <a href="../topics/index.html" title="Using Django">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>