Setup
=====
.. highlight:: bash
To go through this tutorial, you'll need:
#. `Python 2.4 or 2.5 `_. Note that Mac
OSX 10.5 (Leopard) comes with Python 2.5 pre-installed; for 10.4 and
before, follow *Macintosh* in the above link.
#. `TurboGears 2.0
`_ or higher.
#. to :ref:`activate your virtual environment ` before proceeding **if** your TurboGears2 is installed in a virtual environment,
.. note::
Virtual Environment Users
If you've installed turbogears in a virtual environment, it must be
:ref:`activated ` for any ``paster`` commands to work correctly.
The **command-line prompt** is your reminder of whether it is activated
-- *you need to see the (tgenv) prefix on your command-line prompt
to issue a paster command* - something like::
(tgenv)~$ paster ...
#. docutils_ 0.4 or later,
which is used for the wiki's formatting. ``docutils`` is not a required
part of TurboGears, but is needed for this tutorial. Install it with::
$ easy_install docutils
When using ``easy_install`` it doesn't matter what directory you're in.
If you don't have ``easy_install`` you only need to run
http://peak.telecommunity.com/dist/ez_setup.py from any directory.
#. A web browser.
#. Your favorite editor.
#. Two command line windows
(you only *need* one, but two is nicer).
#. A database. Python 2.5 comes with
``sqlite``, so if you have Python 2.5, don't do anything (though you will need
sqlite3.0+ if you want to browse the database from the command line). If you're
running Python 2.4, your best bet is sqlite 3.2+ with `pysqlite
`_ 2.0+. Install it with::
$ easy_install pysqlite
#. **Optional:*** If you're not aware of it, you may also find the
`ipython shell`_ to be helpful. It supports attribute tab completion for
many objects (which can help you find the method you're searching for)
and can display contextual help if you append a question mark onto the
end of an object or method. You can do the same in the standard shell
with the ``dir()`` and ``help()`` functions, but ``ipython`` is more
convenient. ``ipython`` has a number of other convenient features, like
dropping into the debugger on an error; take a look at the `ipython docs`_
for more information. You can install it with::
$ easy_install ipython
A sample :ref:`wiki20 ipython session ` is included at the
end of this tutorial as an introduction.
This tutorial doesn't cover Python at all. Check the `Python
Documentation `_ page for more coverage of
Python.
.. _ipython shell: http://ipython.scipy.org/
.. _ipython docs: http://ipython.scipy.org/moin/Documentation
.. _docutils: http://cheeseshop.python.org/pypi/docutils