.. _installation: インストール ============ .. Installation ============ .. South's current release is :ref:`0.7 <0-7-release-notes>`. South の最新リリースは :ref:`0.7 <0-7-release-notes>` です。 .. There are a few different ways to install South: South をインストールするにはいくつかの方法があります: .. - :ref:`Using easy_install ` (or pip), which is recommended if you want stable releases. - :ref:`Using a Mercurial checkout `, recommended if you want cutting-edge features. - :ref:`Using our downloadable archives `, useful if you don't have easy_install or Mercurial. - :ref:`easy_install を使う ` (または pip), 安定リリース版を使いたい場合におすすめです。 - :ref:`Mercurial でチェックアウトする `, 開発最新版を使いたい場合におすすめです。 - :ref:`アーカイブをダウンロードする `, easy_install も Mercurial も無い場合にご利用下さい。 .. Some Linux distributions are also starting to include South in their package repositories; if you're running unstable Debian you can ``apt-get install python-django-south``, and on new Fedoras you can use ``yum install Django-south``. Note that this may give you an older version - check the version before using the packages. いくつかの Linux ディストリビューションでは South がパッケージリポジトリに登録され始めました; unstable な Debian なら ``apt-get install python-django-south`` を、最新の Fedoraならば ``yum install Django-south`` としてインストールできます。 これらは古いバージョンがインストールされるかもしれないことに注意して下さい - パッケージを利用する前にバージョンをご確認下さい。 .. South should work with versions of Django from 0.97-pre through to 1.2, although some features (such as multi-db) may not be available for older Django versions. South は Django の 0.97-pre から 1.2 までのバージョンで動作しますが、いくつかの機能(マルチDBなど)は古いバージョンの Django ではご利用できません。 .. _installation-easy-install: easy_install を使う ------------------- .. Using easy_install ------------------ .. If you have easy_install available on your system, just type:: システムに easy_install が入っているならば、以下のようにタイプするだけです:: easy_install South .. If you've already got an old version of South, and want to upgrade, use:: もし既に古いバージョンの South をインストールしていて、アップグレードしたい場合は:: easy_install -U South .. That's all that's needed to install the package; you'll now want to :ref:`configure your Django installation `. これでパッケージのインストールは完了です; 次は :ref:`Django へのインストール設定 ` に進んで下さい。 .. _installation-mercurial: Mercurial を使う ---------------- .. Using Mercurial --------------- .. You can install directly from our Mercurial repo, allowing you to recieve updates and bugfixes as soon as they're made. You'll need Mercurial installed on your system; if it's not already, you'll want to get it. The package name is ``mercurial`` on most Linux distributions; OSX and Windows users can download packages from http://mercurial.berkwood.com. アップデートやバグフィックスがすぐに反映されて取得可能な、Mercurial のリポジトリから直接インストールすることもできます。 システムに Mercurial がインストールされている必要があります; まだ Mercurial が入っていない場合は、インストールしましょう。 大抵の Linux ディストリビューションにおけるパッケージ名は ``mercurial`` です; OSX や Windows ユーザーならば、 http://mercurial.berkwood.com からパッケージをダウンロードすることができます。 .. Make sure you're in a directory where you want the ``south`` directory to appear, and run:: ``south`` ディレクトリが出来て欲しいディレクトリにいることを確認し、次のコマンドを実行して下さい:: hg clone http://bitbucket.org/andrewgodwin/south/ .. To update an existing Mercurial checkout to the newest version, run:: Mercurial でチェックアウトしている既存のファイルを最新版にアップデートしたい場合は、次のコマンドを実行します:: hg pull hg up -C tip .. (Rather than running from tip, you can also use the ``stableish`` tag, which is manually set on reasonably stable trunk commits, or pick a version number tag.) (最新版である tip に更新するよりも、安定版の trunk コミットとして設定されている ``stableishi`` タグや、 バージョン番号タグを指定するほうがいいかもしれません) .. Once you have this directory, move onto :ref:`installation-from-directory`. ``south`` ディレクトリが取得できたので :ref:`installation-from-directory` に進みましょう。 .. _installation-archives: アーカイブをダウンロードする ---------------------------- .. Using downloadable archives --------------------------- .. If you're averse to using Mercurial, and don't have easy_install available, then you can install from one of our ``.tar.gz`` files. Mercurial を使用したくない場合や、easy_install がインストールされていない場合などには、 ``.tar.gz`` ファイルからインストールすることができます。 .. First, download the archive of your choice from `our releases page `_, and extract it to create a ``south`` folder. Then, proceed with our instructions for :ref:`installation-from-directory`. まず、 South の `リリースページ `_ からアーカイブをダウンロードして、 ``south`` フォルダができるように解凍します。次に :ref:`installation-from-directory` の説明に進んで下さい。 .. _installation-from-directory: ディレクトリからのインストール ------------------------------ .. Installing from a directory --------------------------- .. If you've obtained a copy of South using either Mercurial or a downloadable archive, you'll need to install the copy you have system-wide. Try running:: Mercurial を使ったり、アーカイブをダウンロードして South のコピーを取得した場合、 システム全体で利用できるように、そのコピーからインストールする必要があります。 次のコマンドを実行して下さい:: python setup.py develop .. If that fails, you don't have ``setuptools`` or an equivalent installed; either install them, or run:: もしこのコマンドが失敗した場合は、 ``setuptools`` かそれと同等のモジュールが インストールされていないので、それらをインストールするか、次のコマンドを実行して下さい:: python setup.py install .. Note that ``develop`` sets the installed version to run from the directory you just created, while ``install`` copies all the files to Python's ``site-packages`` folder, meaning that if you update your checkout you'll need to re-run ``install``. ``develop`` はインストールされたバージョンを作成したディレクトリから起動するように設定しますが、 ``install`` は全てのファイルを Python の ``site-packages`` フォルダにコピーする、という点に注意して下さい。 つまり、チェックアウトしたファイルを更新した際には、再度 ``install`` を実行する必要があります。 .. You could also install South locally for only one project, by either including with your project and modifying ``sys.path`` in your settings file, or (preferably) by using virtualenv, pip and a requirements.txt. A tutorial in how to use these is outside the scope of this documentation, but `there are tutorials elsewhere `_. south をプロジェクト内に含めて settings ファイルの ``sys.path`` を変更するか、 (なるべくなら) virtualenv や pip の requirements.txt を使うことで、 ひとつのプロジェクトに対してのみ South をインストールすることもできます。 これらの使用方法は、このドキュメントの範疇ではありませんが、 `他の場所にチュートリアルがあります `_ 。 .. Once you've done one of those, you'll want to :ref:`configure your Django installation `. ここまでの手順が完了したならば、 :ref:`Django へのインストール設定 ` に進んで下さい。 .. _installation-configure: Django へのインストール設定 --------------------------- .. Configuring your Django installation ------------------------------------ .. Now you've installed South system-wide, you'll need to configure Django to use it. Doing so is simple; just edit your ``settings.py`` and add ``'south'`` to the end of ``INSTALLED_APPS``. さて、システムへの South のインストールが完了したので、次は Django で使用するために設定します。 やることは簡単です; ``settings.py`` を開いて ``INSTALLED_APPS`` に ``'south'`` を追加するだけです。 .. If Django doesn't seem to pick this up, check that you're not overriding ``INSTALLED_APPS`` elsewhere, and that you can run ``import south`` from inside ``./manage.py shell`` with no errors. もし Django が認識しないようならば、どこかで ``INSTALL_APPS`` を上書きしていないか、 または ``./manage.py shell`` において ``import south`` がエラーを出さずに実行できるか確認して下さい。 .. Now South is loaded into your project and ready to go, you'll probably want to take a look at our :ref:`tutorial`. さあ、South がプロジェクトに読み込まれ、使う準備ができました。次は :ref:`tutorial` に進みましょう。