トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

Django インストール 0.96



目次



記事一覧

キーワード

Django インストール 0.96

[Python][Django 0.96][Fedora][Django インストール]


http://docs.djangoproject.com/en/dev/intro/install/

 Pythonのインストール

  • バージョン 2.3 〜 2.6 ならどれでもよい
  • バージョン 3.0 は 現在サポートされていない
  • 推奨は2.5以降
  • 2.5以降を利用すれば、SQLiteが同梱されるため、データベースを構成する必要がない

Fedora Core 6 のPythonのバージョンを確認

  • 自分の現在のテストサーバーがFC6のため
# python
Python 2.4.4 (#1, Oct 23 2006, 13:58:00) 
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

2.6.2のダウンロード

http://www.python.org/download/releases/2.6.2/
http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz
wgetでダウンロード

# wget http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz

既存を削除して最新をインストールと思ったが、既存のバージョンが管理ツールなどで激しく使われており既存を削除できない
# rpm -e python-2.4.4-1.fc6
エラー: 依存性の欠如:
        libpython2.4.so.1.0 は (インストール済み)libsemanage-1.6.17-1.i386 に必要とされています
        libpython2.4.so.1.0 は (インストール済み)gnome-python2-gnomevfs-2.16.2-2.fc6.i386 に必要とされています
        python(abi) = 2.4 は (インストール済み)rhpl-0.194-1.i386 に必要とされています
        python(abi) = 2.4 は (インストール済み)newt-0.52.2-9.i386 に必要とされています
        python(abi) = 2.4 は (インストール済み)gnome-menus-2.16.0-2.fc6.i386 に必要とされています
        python(abi) = 2.4 は (インストール済み)pyxf86config-0.3.31-2.fc6.i386 に必要とされています
        python(abi) = 2.4 は (インストール済み)libbtctl-0.6.0-9.1.i386 に必要とされています
               :
以下などを参考に普通にインストールしてみる

http://lowlife.jp/yasusii/wiki/InstallingAnotherVersionOfPython.html

  • ダウンロードしたファイルを解凍READMEを参照

# tar xzvf Python-2.6.2.tgz

To start building right away (on UNIX): type "./configure" in the current directory and when it finishes, type "make". This creates an executable "./python"; to install in /usr/local, first do "su root" and then "make install".


  • 解凍されたディレクトリで、以下を実行
#./configure
   :
creating Modules/Setup.local
creating Makefile
#make
   :
changing mode of build/scripts-2.6/2to3 from 644 to 755
changing mode of build/scripts-2.6/smtpd.py from 644 to 755

カレントディレクトリに実行可能の python ファイルが作成される。/usr/localへインストールする(rootで)

#make install
   :
rm -f /usr/local/bin/python-config
(cd /usr/local/bin; ln -s python2.6-config python-config)
/usr/bin/install -c -m 644 ./Misc/python.man \
               /usr/local/share/man/man1/python.1

Python2.6.2の実行

2.6.2が実行された
# python
Python 2.6.2 (r262:71600, Jun 13 2009, 02:28:29) 
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
明示しない場合2.4か2.6かどちらが起動するかは、PATHの設定に依存
# whereis python
python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python /usr/local/bin/python2.6 /usr/local/bin/python2.6-config /usr/local/lib/python2.6 /usr/include/python2.4 /usr/share/man/man1/python.1.gz

 データベースのインストール

  • Python2.5以降の場合不要。"large"なデータベースを使用したい場合、こちら参照

PostgreSQL

 Djangoインストールの3つの方法

OSのディストリビューションが提供するバージョンをインストール
  • yumさんに聞いてみる
# yum search django
   :
Django.noarch                            0.96.1-1.fc6           extras          
Matched from:
Django
Django is a high-level Python Web framework that encourages rapid
development and a clean, pragmatic design. It focuses on automating as
much as possible and adhering to the DRY (Don't Repeat Yourself)
principle.
http://www.djangoproject.com/
公式リリースを使用する
開発版を使用する

 Djangoのインストール

最新版のダウンロード

ダウンロードして、解凍

# wget http://www.djangoproject.com/download/1.0.2/tarball/

セットアップスクリプトの実行

  • 解凍されたフォルダに入って、以下を実行
Django-1.0.2-final]# python setup.py install

準備完了



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto

Copyright© 矢木 浩人 All Rights Reserved.