2008-08-24 00:25:40 +02:00
|
|
|
Quick install guide
|
|
|
|
===================
|
|
|
|
|
|
|
|
Before you can use Django, you'll need to get it installed. We have a
|
2010-08-19 21:27:44 +02:00
|
|
|
:doc:`complete installation guide </topics/install>` that covers all the
|
2008-08-24 00:25:40 +02:00
|
|
|
possibilities; this guide will guide you to a simple, minimal installation
|
|
|
|
that'll work while you walk through the introduction.
|
|
|
|
|
|
|
|
Install Python
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Being a Python Web framework, Django requires Python. It works with any Python
|
2012-03-31 10:24:29 +02:00
|
|
|
version from 2.6 to 2.7 (due to backwards incompatibilities in Python 3.0,
|
2011-06-09 22:01:28 +02:00
|
|
|
Django does not currently work with Python 3.0; see :doc:`the Django FAQ
|
|
|
|
</faq/install>` for more information on supported Python versions and the 3.0
|
|
|
|
transition), these versions of Python include a lightweight database called
|
|
|
|
SQLite_ so you won't need to set up a database just yet.
|
2008-08-24 00:25:40 +02:00
|
|
|
|
|
|
|
.. _sqlite: http://sqlite.org/
|
|
|
|
|
|
|
|
Get Python at http://www.python.org. If you're running Linux or Mac OS X, you
|
|
|
|
probably already have it installed.
|
|
|
|
|
2008-08-26 17:52:21 +02:00
|
|
|
.. admonition:: Django on Jython
|
|
|
|
|
|
|
|
If you use Jython_ (a Python implementation for the Java platform), you'll
|
2010-08-19 21:27:44 +02:00
|
|
|
need to follow a few additional steps. See :doc:`/howto/jython` for details.
|
2008-08-26 17:52:21 +02:00
|
|
|
|
2008-11-01 21:51:54 +01:00
|
|
|
.. _jython: http://www.jython.org/
|
2008-08-26 17:52:21 +02:00
|
|
|
|
2010-11-23 04:54:13 +01:00
|
|
|
You can verify that Python is installed by typing ``python`` from your shell;
|
|
|
|
you should see something like::
|
2008-08-24 00:25:40 +02:00
|
|
|
|
2012-03-31 10:24:29 +02:00
|
|
|
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
|
|
|
|
[GCC 4.4.5] on linux2
|
2008-08-24 00:25:40 +02:00
|
|
|
Type "help", "copyright", "credits" or "license" for more information.
|
|
|
|
>>>
|
2010-08-19 21:27:44 +02:00
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
Set up a database
|
|
|
|
-----------------
|
|
|
|
|
2012-04-21 14:35:06 +02:00
|
|
|
This step is only necessary if you'd like to work with a "large" database engine
|
|
|
|
like PostgreSQL, MySQL, or Oracle. To install such a database, consult the
|
|
|
|
:ref:`database installation information <database-installation>`.
|
2008-08-24 00:25:40 +02:00
|
|
|
|
|
|
|
Remove any old versions of Django
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
If you are upgrading your installation of Django from a previous version, you
|
|
|
|
will need to :ref:`uninstall the old Django version before installing the new
|
|
|
|
version <removing-old-versions-of-django>`.
|
|
|
|
|
|
|
|
Install Django
|
|
|
|
--------------
|
|
|
|
|
|
|
|
You've got three easy options to install Django:
|
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* Install a version of Django :doc:`provided by your operating system
|
|
|
|
distribution </misc/distributions>`. This is the quickest option for those
|
|
|
|
who have operating systems that distribute Django.
|
2008-08-24 00:25:40 +02:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* :ref:`Install an official release <installing-official-release>`. This
|
|
|
|
is the best approach for users who want a stable version number and aren't
|
|
|
|
concerned about running a slightly older version of Django.
|
2010-08-19 21:27:44 +02:00
|
|
|
|
2011-10-14 02:12:01 +02:00
|
|
|
* :ref:`Install the latest development version
|
|
|
|
<installing-development-version>`. This is best for users who want the
|
|
|
|
latest-and-greatest features and aren't afraid of running brand-new code.
|
2010-08-19 21:27:44 +02:00
|
|
|
|
2010-10-19 02:26:39 +02:00
|
|
|
.. admonition:: Always refer to the documentation that corresponds to the
|
|
|
|
version of Django you're using!
|
2008-08-24 00:25:40 +02:00
|
|
|
|
2010-01-10 18:47:53 +01:00
|
|
|
If you do either of the first two steps, keep an eye out for parts of the
|
2008-08-24 00:25:40 +02:00
|
|
|
documentation marked **new in development version**. That phrase flags
|
2010-01-10 18:47:53 +01:00
|
|
|
features that are only available in development versions of Django, and
|
|
|
|
they likely won't work with an official release.
|
2010-11-23 04:54:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
Verifying
|
|
|
|
---------
|
|
|
|
|
|
|
|
To verify that Django can be seen by Python, type ``python`` from your shell.
|
|
|
|
Then at the Python prompt, try to import Django::
|
|
|
|
|
|
|
|
>>> import django
|
2012-04-28 18:02:01 +02:00
|
|
|
>>> print(django.get_version())
|
2012-03-23 19:05:31 +01:00
|
|
|
1.4
|
2010-11-23 04:54:13 +01:00
|
|
|
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
That's it!
|
|
|
|
----------
|
|
|
|
|
2010-08-19 21:27:44 +02:00
|
|
|
That's it -- you can now :doc:`move onto the tutorial </intro/tutorial01>`.
|
2008-08-24 00:25:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|