目次
文書の過去の版を表示しています。
Djangoのインストール
ここでは、Pythonがインストールされていることを前提に説明を進めることにする。
Python 環境の整え方は、pythonbrew の使い方やPython のインストールを参照のこと。
pip を利用する場合
$ pip install django
Downloading/unpacking django
Downloading Django-1.5.tar.gz (8.0MB): 8.0MB downloaded
Running setup.py egg_info for package django
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
Installing collected packages: django
Running setup.py install for django
changing mode of build/scripts-3.3/django-admin.py from 664 to 775
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
changing mode of /home/tomoyan/.pythonbrew/venvs/Python-3.3.0/py33dj15/bin/django-admin.py to 775
Successfully installed django
Cleaning up...
Windows tar ボールからインストールする場合
※pipでインストール可能。
- Django | Download より Django-x.x.x.tar.gz をダウンロードする。
- Django-x.x.tar.gz を適当なフォルダに解凍する。
- コマンドラインにて解凍したフォルダにcd(Change directory)して以下のコマンドを実行する。
> python setup.py install
Linux(Fedora) yum でインストールする場合
※pipでインストール可能。
- djangoパッケージをインストールする。
# yum install django
Django Adminツールの動作確認
上記のインストールが完了すると、django-admin.py がパスの通った場所に存在するので、以下のコマンドを実行して動作確認を行う。
$ django-admin.py help
Usage: django-admin.py subcommand [options] [args]
Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, the
DJANGO_SETTINGS_MODULE environment variable will be
used.
--pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
--traceback Print traceback on exception
--version show program's version number and exit
-h, --help show this help message and exit
~省略~