Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 3f3c3d137bda7f89843b9ed1f7e97897 > files > 8429

python-django14-1.4.21-1.mga4.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">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>How to install Django &mdash; Django 1.4.21 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.21',
        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.21 documentation" href="../index.html" />
    <link rel="up" title="Using Django" href="index.html" />
    <link rel="next" title="Models and databases" href="db/index.html" />
    <link rel="prev" title="Using Django" 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.21 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="index.html" title="Using Django">previous</a> 
     |
    <a href="index.html" title="Using Django" accesskey="U">up</a>
   |
    <a href="db/index.html" title="Models and databases">next</a> &raquo;</div>
    </div>
    
    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="topics-install">
            
  <div class="section" id="s-how-to-install-django">
<span id="how-to-install-django"></span><h1>How to install Django<a class="headerlink" href="#how-to-install-django" title="Permalink to this headline">¶</a></h1>
<p>This document will get you up and running with Django.</p>
<div class="section" id="s-install-python">
<span id="install-python"></span><h2>Install Python<a class="headerlink" href="#install-python" title="Permalink to this headline">¶</a></h2>
<p>Being a Python Web framework, Django requires Python.</p>
<p>It works with any Python version from 2.5 to 2.7 (due to backwards
incompatibilities in Python 3.0, Django does not currently work with
Python 3.0; see <a class="reference internal" href="../faq/install.html"><em>the Django FAQ</em></a> for more
information on supported Python versions and the 3.0 transition).</p>
<p>Get Python at <a class="reference external" href="http://www.python.org">http://www.python.org</a>. If you&#8217;re running Linux or Mac OS X, you
probably already have it installed.</p>
<div class="admonition-django-on-jython admonition">
<p class="first admonition-title">Django on Jython</p>
<p class="last">If you use <a class="reference external" href="http://jython.org/">Jython</a> (a Python implementation for the Java platform), you&#8217;ll
need to follow a few additional steps. See <a class="reference internal" href="../howto/jython.html"><em>Running Django on Jython</em></a> for details.</p>
</div>
<div class="admonition-python-on-windows admonition">
<p class="first admonition-title">Python on Windows</p>
<p>On Windows, you might need to adjust your <tt class="docutils literal"><span class="pre">PATH</span></tt> environment variable
to include paths to Python executable and additional scripts. For example,
if your Python is installed in <tt class="docutils literal"><span class="pre">C:\Python27\</span></tt>, the following paths need
to be added to <tt class="docutils literal"><span class="pre">PATH</span></tt>:</p>
<div class="last highlight-python"><pre>C:\Python27\;C:\Python27\Scripts;</pre>
</div>
</div>
</div>
<div class="section" id="s-install-apache-and-mod-wsgi">
<span id="install-apache-and-mod-wsgi"></span><h2>Install Apache and mod_wsgi<a class="headerlink" href="#install-apache-and-mod-wsgi" title="Permalink to this headline">¶</a></h2>
<p>If you just want to experiment with Django, skip ahead to the next
section; Django includes a lightweight web server you can use for
testing, so you won&#8217;t need to set up Apache until you&#8217;re ready to
deploy Django in production.</p>
<p>If you want to use Django on a production site, use <a class="reference external" href="http://httpd.apache.org/">Apache</a> with
<a class="reference external" href="http://code.google.com/p/modwsgi/">mod_wsgi</a>. mod_wsgi can operate in one of two modes: an embedded
mode and a daemon mode. In embedded mode, mod_wsgi is similar to
mod_perl &#8211; it embeds Python within Apache and loads Python code into
memory when the server starts. Code stays in memory throughout the
life of an Apache process, which leads to significant performance
gains over other server arrangements. In daemon mode, mod_wsgi spawns
an independent daemon process that handles requests. The daemon
process can run as a different user than the Web server, possibly
leading to improved security, and the daemon process can be restarted
without restarting the entire Apache Web server, possibly making
refreshing your codebase more seamless. Consult the mod_wsgi
documentation to determine which mode is right for your setup. Make
sure you have Apache installed, with the mod_wsgi module activated.
Django will work with any version of Apache that supports mod_wsgi.</p>
<p>See <a class="reference internal" href="../howto/deployment/wsgi/modwsgi.html"><em>How to use Django with mod_wsgi</em></a>
for information on how to configure mod_wsgi once you have it
installed.</p>
<p>If you can&#8217;t use mod_wsgi for some reason, fear not: Django supports many other
deployment options. One is <a class="reference internal" href="../howto/deployment/fastcgi.html"><em>uWSGI</em></a>; it works
very well with <a class="reference external" href="http://nginx.org/">nginx</a>. Another is <a class="reference internal" href="../howto/deployment/fastcgi.html"><em>FastCGI</em></a>,
perfect for using Django with servers other than Apache. Additionally, Django
follows the WSGI spec (<span class="target" id="index-0"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-3333"><strong>PEP 3333</strong></a>), which allows it to run on a variety of
server platforms. See the <a class="reference external" href="https://code.djangoproject.com/wiki/ServerArrangements">server-arrangements wiki page</a> for specific
installation instructions for each platform.</p>
</div>
<div class="section" id="s-get-your-database-running">
<span id="s-database-installation"></span><span id="get-your-database-running"></span><span id="database-installation"></span><h2>Get your database running<a class="headerlink" href="#get-your-database-running" title="Permalink to this headline">¶</a></h2>
<p>If you plan to use Django&#8217;s database API functionality, you&#8217;ll need to make
sure a database server is running. Django supports many different database
servers and is officially supported with <a class="reference external" href="http://www.postgresql.org/">PostgreSQL</a>, <a class="reference external" href="http://www.mysql.com/">MySQL</a>, <a class="reference external" href="http://www.oracle.com/">Oracle</a> and
<a class="reference external" href="http://www.sqlite.org/">SQLite</a>.</p>
<p>If you are developing a simple project or something you don&#8217;t plan to deploy
in a production environment, SQLite is generally the simplest option as it
doesn&#8217;t require running a separate server. However, SQLite has many differences
from other databases, so if you are working on something substantial, it&#8217;s
recommended to develop with the same database as you plan on using in
production.</p>
<p>In addition to the officially supported databases, there are backends provided
by 3rd parties that allow you to use other databases with Django:</p>
<ul class="simple">
<li><a class="reference external" href="http://code.google.com/p/sqlany-django/">Sybase SQL Anywhere</a></li>
<li><a class="reference external" href="http://code.google.com/p/ibm-db/">IBM DB2</a></li>
<li><a class="reference external" href="http://code.google.com/p/django-mssql/">Microsoft SQL Server 2005</a></li>
<li><a class="reference external" href="http://code.google.com/p/django-firebird/">Firebird</a></li>
<li><a class="reference external" href="http://code.google.com/p/django-pyodbc/">ODBC</a></li>
</ul>
<p>The Django versions and ORM features supported by these unofficial backends
vary considerably. Queries regarding the specific capabilities of these
unofficial backends, along with any support queries, should be directed to the
support channels provided by each 3rd party project.</p>
<p>In addition to a database backend, you&#8217;ll need to make sure your Python
database bindings are installed.</p>
<ul>
<li><p class="first">If you&#8217;re using PostgreSQL, you&#8217;ll need the <tt class="docutils literal"><span class="pre">postgresql_psycopg2</span></tt> package.
You might want to refer to our <a class="reference internal" href="../ref/databases.html#postgresql-notes"><em>PostgreSQL notes</em></a> for
further technical details specific to this database.</p>
<p>If you&#8217;re on Windows, check out the unofficial <a class="reference external" href="http://stickpeople.com/projects/python/win-psycopg/">compiled Windows version</a>.</p>
</li>
<li><p class="first">If you&#8217;re using MySQL, you&#8217;ll need <a class="reference external" href="http://sourceforge.net/projects/mysql-python">MySQLdb</a>, version 1.2.1p2 or higher. You
will also want to read the database-specific <a class="reference internal" href="../ref/databases.html#mysql-notes"><em>notes for the MySQL
backend</em></a>.</p>
</li>
<li><p class="first">If you&#8217;re using Oracle, you&#8217;ll need a copy of <a class="reference external" href="http://cx-oracle.sourceforge.net/">cx_Oracle</a>, but please
read the database-specific <a class="reference internal" href="../ref/databases.html#oracle-notes"><em>notes for the Oracle backend</em></a>
for important information regarding supported versions of both Oracle and
<tt class="docutils literal"><span class="pre">cx_Oracle</span></tt>.</p>
</li>
<li><p class="first">If you&#8217;re using an unofficial 3rd party backend, please consult the
documentation provided for any additional requirements.</p>
</li>
</ul>
<p>If you plan to use Django&#8217;s <tt class="docutils literal"><span class="pre">manage.py</span> <span class="pre">syncdb</span></tt> command to
automatically create database tables for your models, you&#8217;ll need to
ensure that Django has permission to create and alter tables in the
database you&#8217;re using; if you plan to manually create the tables, you
can simply grant Django <tt class="docutils literal"><span class="pre">SELECT</span></tt>, <tt class="docutils literal"><span class="pre">INSERT</span></tt>, <tt class="docutils literal"><span class="pre">UPDATE</span></tt> and
<tt class="docutils literal"><span class="pre">DELETE</span></tt> permissions. On some databases, Django will need
<tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></tt> privileges during <tt class="docutils literal"><span class="pre">syncdb</span></tt> but won&#8217;t issue
<tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></tt> statements on a table once <tt class="docutils literal"><span class="pre">syncdb</span></tt> has created it.</p>
<p>If you&#8217;re using Django&#8217;s <a class="reference internal" href="testing.html"><em>testing framework</em></a> to test database queries,
Django will need permission to create a test database.</p>
</div>
<div class="section" id="s-remove-any-old-versions-of-django">
<span id="s-removing-old-versions-of-django"></span><span id="remove-any-old-versions-of-django"></span><span id="removing-old-versions-of-django"></span><h2>Remove any old versions of Django<a class="headerlink" href="#remove-any-old-versions-of-django" title="Permalink to this headline">¶</a></h2>
<p>If you are upgrading your installation of Django from a previous version,
you will need to uninstall the old Django version before installing the
new version.</p>
<p>If you installed Django using <tt class="docutils literal"><span class="pre">setup.py</span> <span class="pre">install</span></tt>, uninstalling
is as simple as deleting the <tt class="docutils literal"><span class="pre">django</span></tt> directory from your Python
<tt class="docutils literal"><span class="pre">site-packages</span></tt>.</p>
<p>If you installed Django from a Python egg, remove the Django <tt class="docutils literal"><span class="pre">.egg</span></tt> file,
and remove the reference to the egg in the file named <tt class="docutils literal"><span class="pre">easy-install.pth</span></tt>.
This file should also be located in your <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</p>
<div class="admonition-where-are-my-site-packages-stored admonition" id="finding-site-packages">
<p class="first admonition-title">Where are my <tt class="docutils literal"><span class="pre">site-packages</span></tt> stored?</p>
<p>The location of the <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory depends on the operating
system, and the location in which Python was installed. To find out your
system&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt> location, execute the following:</p>
<div class="highlight-bash"><div class="highlight"><pre>python -c <span class="s2">&quot;from distutils.sysconfig import get_python_lib; print get_python_lib()&quot;</span>
</pre></div>
</div>
<p>(Note that this should be run from a shell prompt, not a Python interactive
prompt.)</p>
<p class="last">Some Debian-based Linux distributions have separate <tt class="docutils literal"><span class="pre">site-packages</span></tt>
directories for user-installed packages, such as when installing Django
from a downloaded tarball. The command  listed above will give you the
system&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt>, the user&#8217;s directory can be found in
<tt class="docutils literal"><span class="pre">/usr/local/lib/</span></tt> instead of <tt class="docutils literal"><span class="pre">/usr/lib/</span></tt>.</p>
</div>
</div>
<div class="section" id="s-install-the-django-code">
<span id="s-install-django-code"></span><span id="install-the-django-code"></span><span id="install-django-code"></span><h2>Install the Django code<a class="headerlink" href="#install-the-django-code" title="Permalink to this headline">¶</a></h2>
<p>Installation instructions are slightly different depending on whether you&#8217;re
installing a distribution-specific package, downloading the latest official
release, or fetching the latest development version.</p>
<p>It&#8217;s easy, no matter which way you choose.</p>
<div class="section" id="s-installing-a-distribution-specific-package">
<span id="installing-a-distribution-specific-package"></span><h3>Installing a distribution-specific package<a class="headerlink" href="#installing-a-distribution-specific-package" title="Permalink to this headline">¶</a></h3>
<p>Check the <a class="reference internal" href="../misc/distributions.html"><em>distribution specific notes</em></a> to see if
your platform/distribution provides official Django packages/installers.
Distribution-provided packages will typically allow for automatic installation
of dependencies and easy upgrade paths.</p>
</div>
<div class="section" id="s-installing-an-official-release-with-pip">
<span id="s-installing-official-release"></span><span id="installing-an-official-release-with-pip"></span><span id="installing-official-release"></span><h3>Installing an official release with <tt class="docutils literal"><span class="pre">pip</span></tt><a class="headerlink" href="#installing-an-official-release-with-pip" title="Permalink to this headline">¶</a></h3>
<p>This is the recommended way to install Django.</p>
<ol class="arabic">
<li><p class="first">Install <a class="reference external" href="http://www.pip-installer.org/">pip</a>. The easiest is to use the <a class="reference external" href="http://www.pip-installer.org/en/latest/installing.html#using-the-installer">standalone pip installer</a>. If your
distribution already has <tt class="docutils literal"><span class="pre">pip</span></tt> installed, you might need to update it if
it&#8217;s outdated. (If it&#8217;s outdated, you&#8217;ll know because installation won&#8217;t
work.)</p>
</li>
<li><p class="first">(optional) Take a look at <a class="reference external" href="http://www.virtualenv.org/">virtualenv</a> and <a class="reference external" href="http://www.doughellmann.com/docs/virtualenvwrapper/">virtualenvwrapper</a>. These tools
provide isolated Python environments, which are more practical than
installing packages systemwide. They also allow installing packages
without administrator privileges. It&#8217;s up to you to decide if you want to
learn and use them.</p>
</li>
<li><p class="first">If you&#8217;re using Linux, Mac OS X or some other flavor of Unix, enter the
command <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">pip</span> <span class="pre">install</span> <span class="pre">Django</span></tt> at the shell prompt. If you&#8217;re using
Windows, start a command shell with administrator privileges and run
the command <tt class="docutils literal"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">Django</span></tt>. This will install Django in your Python
installation&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</p>
<p>If you&#8217;re using a virtualenv, you don&#8217;t need <tt class="docutils literal"><span class="pre">sudo</span></tt> or administrator
privileges, and this will install Django in the virtualenv&#8217;s
<tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</p>
</li>
</ol>
</div>
<div class="section" id="s-installing-an-official-release-manually">
<span id="installing-an-official-release-manually"></span><h3>Installing an official release manually<a class="headerlink" href="#installing-an-official-release-manually" title="Permalink to this headline">¶</a></h3>
<ol class="arabic simple">
<li>Download the latest release from our <a class="reference external" href="https://www.djangoproject.com/download/">download page</a>.</li>
<li>Untar the downloaded file (e.g. <tt class="docutils literal"><span class="pre">tar</span> <span class="pre">xzvf</span> <span class="pre">Django-X.Y.tar.gz</span></tt>,
where <tt class="docutils literal"><span class="pre">X.Y</span></tt> is the version number of the latest release).
If you&#8217;re using Windows, you can download the command-line tool
<a class="reference external" href="http://gnuwin32.sourceforge.net/packages/bsdtar.htm">bsdtar</a> to do this, or you can use a GUI-based tool such as <a class="reference external" href="http://www.7-zip.org/">7-zip</a>.</li>
<li>Change into the directory created in step 2 (e.g. <tt class="docutils literal"><span class="pre">cd</span> <span class="pre">Django-X.Y</span></tt>).</li>
<li>If you&#8217;re using Linux, Mac OS X or some other flavor of Unix, enter the
command <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt> at the shell prompt. If you&#8217;re
using Windows, start a command shell with administrator privileges and
run the command <tt class="docutils literal"><span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt>. This will install Django in
your Python installation&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</li>
</ol>
</div>
<div class="section" id="s-installing-the-development-version">
<span id="s-installing-development-version"></span><span id="installing-the-development-version"></span><span id="installing-development-version"></span><h3>Installing the development version<a class="headerlink" href="#installing-the-development-version" title="Permalink to this headline">¶</a></h3>
<div class="admonition-tracking-django-development admonition">
<p class="first admonition-title">Tracking Django development</p>
<p class="last">If you decide to use the latest development version of Django,
you&#8217;ll want to pay close attention to <a class="reference external" href="https://code.djangoproject.com/timeline">the development timeline</a>,
and you&#8217;ll want to keep an eye on <a class="reference external" href="https://code.djangoproject.com/wiki/BackwardsIncompatibleChanges">the list of
backwards-incompatible changes</a>. This will help you stay on top
of any new features you might want to use, as well as any changes
you&#8217;ll need to make to your code when updating your copy of Django.
(For stable releases, any necessary changes are documented in the
release notes.)</p>
</div>
<p>If you&#8217;d like to be able to update your Django code occasionally with the
latest bug fixes and improvements, follow these instructions:</p>
<ol class="arabic">
<li><p class="first">Make sure that you have <a class="reference external" href="http://subversion.tigris.org/">Subversion</a>, <a class="reference external" href="http://git-scm.com/">Git</a>, or <a class="reference external" href="http://mercurial.selenic.com/">Mercurial</a> installed, and
that you can run its commands from a shell. (Enter <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">help</span></tt>,
<tt class="docutils literal"><span class="pre">git</span> <span class="pre">help</span></tt>, or <tt class="docutils literal"><span class="pre">hg</span> <span class="pre">help</span></tt> at a shell prompt to test this.) Note that
the Subversion repository is the canonical source for the official
Git and Mercurial repositories and as such will always be the most up-to-date.</p>
</li>
<li><p class="first">Check out Django&#8217;s main development branch (the &#8216;trunk&#8217;) like so:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Subversion</span>
svn co https://code.djangoproject.com/svn/django/trunk/ django-trunk
</pre></div>
</div>
<p>Mirrors of the Subversion repository can be obtained like so:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="c"># Git (requires version 1.6.6 or later)</span>
git clone https://github.com/django/django.git
<span class="c"># or (works with all versions)</span>
git clone git://github.com/django/django.git

<span class="c"># Mercurial</span>
hg clone https://bitbucket.org/django/django
</pre></div>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">These mirrors should be updated every 5 minutes but aren&#8217;t guaranteed
to be up-to-date since they are hosted on external services.</p>
</div>
</li>
<li><p class="first">Next, make sure that the Python interpreter can load Django&#8217;s code. The most
convenient way to do this is to <a class="reference external" href="http://docs.python.org/install/index.html#modifying-python-s-search-path">modify Python&#8217;s search path</a>. Add a <tt class="docutils literal"><span class="pre">.pth</span></tt>
file containing the full path to the <tt class="docutils literal"><span class="pre">django-trunk</span></tt> directory to your
system&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory. For example, on a Unix-like system:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nb">echo </span>WORKING-DIR/django-trunk &gt; SITE-PACKAGES-DIR/django.pth
</pre></div>
</div>
<p>(In the above line, change <tt class="docutils literal"><span class="pre">SITE-PACKAGES-DIR</span></tt> to match the location of
your system&#8217;s <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory, as explained in the
<a class="reference internal" href="#finding-site-packages"><em>Where are my site-packages stored?</em></a> section
above. Change <tt class="docutils literal"><span class="pre">WORKING-DIR/django-trunk</span></tt> to match the full path to your
new <tt class="docutils literal"><span class="pre">django-trunk</span></tt> directory.)</p>
</li>
<li><p class="first">On Unix-like systems, create a symbolic link to the file
<tt class="docutils literal"><span class="pre">django-trunk/django/bin/django-admin.py</span></tt> in a directory on your system
path, such as <tt class="docutils literal"><span class="pre">/usr/local/bin</span></tt>. For example:</p>
<div class="highlight-bash"><div class="highlight"><pre>ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin
</pre></div>
</div>
<p>(In the above line, change WORKING-DIR to match the full path to your new
<tt class="docutils literal"><span class="pre">django-trunk</span></tt> directory.)</p>
<p>This simply lets you type <tt class="docutils literal"><span class="pre">django-admin.py</span></tt> from within any directory,
rather than having to qualify the command with the full path to the file.</p>
<p>On Windows systems, the same result can be achieved by copying the file
<tt class="docutils literal"><span class="pre">django-trunk/django/bin/django-admin.py</span></tt> to somewhere on your system
path, for example <tt class="docutils literal"><span class="pre">C:\Python27\Scripts</span></tt>.</p>
</li>
</ol>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Don&#8217;t run <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt>, because you&#8217;ve already
carried out the equivalent actions in steps 3 and 4. Furthermore, this is
known to cause problems when updating to a more recent version of Django.</p>
</div>
<p>When you want to update your copy of the Django source code, just run the
command <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">update</span></tt> from within the <tt class="docutils literal"><span class="pre">django-trunk</span></tt> directory. When you do
this, Subversion will automatically download any changes. The equivalent
command for Git is <tt class="docutils literal"><span class="pre">git</span> <span class="pre">pull</span></tt>, and for Mercurial <tt class="docutils literal"><span class="pre">hg</span> <span class="pre">pull</span> <span class="pre">--update</span></tt>.</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="#">How to install Django</a><ul>
<li><a class="reference internal" href="#install-python">Install Python</a></li>
<li><a class="reference internal" href="#install-apache-and-mod-wsgi">Install Apache and mod_wsgi</a></li>
<li><a class="reference internal" href="#get-your-database-running">Get your database running</a></li>
<li><a class="reference internal" href="#remove-any-old-versions-of-django">Remove any old versions of Django</a></li>
<li><a class="reference internal" href="#install-the-django-code">Install the Django code</a><ul>
<li><a class="reference internal" href="#installing-a-distribution-specific-package">Installing a distribution-specific package</a></li>
<li><a class="reference internal" href="#installing-an-official-release-with-pip">Installing an official release with <tt class="docutils literal"><span class="pre">pip</span></tt></a></li>
<li><a class="reference internal" href="#installing-an-official-release-manually">Installing an official release manually</a></li>
<li><a class="reference internal" href="#installing-the-development-version">Installing the development version</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="index.html">Using Django</a></li>
    
    
      <li>Next: <a href="db/index.html">Models and databases</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../index.html">Django 1.4.21 documentation</a>
        
          <ul><li><a href="index.html">Using Django</a>
        
        <ul><li>How to install Django</li></ul>
        </li></ul>
      </li>
  </ul>  

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/topics/install.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">Jul 10, 2015</p>
          </div> 
        
      
    </div>
    
    <div id="ft">
      <div class="nav">
    &laquo; <a href="index.html" title="Using Django">previous</a> 
     |
    <a href="index.html" title="Using Django" accesskey="U">up</a>
   |
    <a href="db/index.html" title="Models and databases">next</a> &raquo;</div>
    </div>
  </div>

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