View All Posts. MiCHiLU.com powered by Django ;-)

[Django][Python]: Django / Python path周りのメモ

Python path周りのメモ。

tarballをDownloadして、解凍したものをまとめて置いておく。

$ ls -1 /Volumes/data/pylib
BeautifulSoup.py
Django-0.96
Django-0.96.tar.gz
Gnosis_Utils-1.2.1
Gnosis_Utils-1.2.1.tar.bz2
Imaging-1.1.6
Imaging-1.1.6.tar.gz
Pygments-0.8.1
django_projects
docutils-0.4
docutils-0.4.tar.gz
ez_setup.py
ipython-0.8.1
ipython-0.8.1.tar.gz
lxml-1.3.2
pysqlite-2.3.3
pysqlite-2.3.3.tar.gz
python-memcached-1.36
python-memcached-1.36.tar.gz
site-packages
src

Subversionでcheckoutできるものは、別でまとめて置いておく。

$ ls -1 /Volumes/data/checkouts
django
lxml
trac

コンパイルが必要そうなやつは、素直に全バージョンに入れとく。

$ python2.3 setup.py install
$ python2.4 setup.py install
$ python2.5 setup.py install

Python pathを通す。

$ ls -l /Volumes/data/pylib/site-packages
pth
python2.3 -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages
python2.4 -> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
python2.5 -> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages

$ ls -l /Volumes/data/pylib/site-packages/*/pylib.pth
/Volumes/data/pylib/site-packages/pth/pylib.pth
/Volumes/data/pylib/site-packages/python2.3/pylib.pth -> /Volumes/data/pylib/site-packages/pth/pylib.pth
/Volumes/data/pylib/site-packages/python2.4/pylib.pth -> /Volumes/data/pylib/site-packages/pth/pylib.pth
/Volumes/data/pylib/site-packages/python2.5/pylib.pth -> /Volumes/data/pylib/site-packages/pth/pylib.pth

$ cat /Volumes/data/pylib/site-packages/pth/pylib.pth
/Volumes/data/pylib/src
/Volumes/data/pylib/django_projects

使いたいパッケージのシンボリックリンクを作っておく。

$ ls -l /Volumes/data/pylib/src
BeautifulSoup.py -> ../BeautifulSoup.py
PIL -> ../Imaging-1.1.6/PIL
django -> ../Django-0.96/django
docutils -> ../docutils-0.4/docutils
gnosis -> ../Gnosis_Utils-1.2.1/gnosis
memcache.py -> ../python-memcached-1.36/memcache.py
pygments -> ../Pygments-0.8.1/pygments
pysqlite2 -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/pysqlite2
roman.py -> ../docutils-0.4/extras/roman.py

Django projectへのシンボリックリンクも作成しておく。

$ ls -l /Volumes/data/pylib/django_projects
michilu -> ../../dj/michilu
secret -> ../../dj/secret

Django project置き場。trunk/bracheの別、何のprojectかが判るディレクトリ名にする。 runserverで起動する時は、使用するprojectのnamespaceが通るように、シンボリックリンクを張る。

$ ls -l /Volumes/data/dj
db
michilu -> michilu_trunk
michilu_branche
michilu_trunk
secret -> secret_branche
secret_trunk
secret_branche

SQLiteのDatabaseファイル置き場。

$ ls -l /Volumes/data/dj/db
michilu_branche.db -> michilu_trunk.db
michilu_trunk.db
secret_trunk.db
secret_branche.db

いろいろな組み合わせで、runserverする。

#### Python 2.3 + Django 0.96 + michilu.com trunk
$ ln -s michilu_trunk michilu
$ cd michilu
$ python2.3 manage.py runserver
Validating models...
0 errors found.

Django version 0.96, using settings 'michilu_trunk.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

#### Python 2.4 + Django 0.97-pre rev.5515 + michilu.com trunk
$ ln -s ../../checkouts/django/5515/django
$ python2.4 manage.py runserver
Validating models...
0 errors found.

Django version 0.97-pre, using settings 'michilu_trunk.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

#### Python 2.5 + Django 0.97-pre trunk + michilu.com trunk
$ rm django
$ ln -s ../../checkouts/django/trunk/django
$ python2.5 manage.py runserver
Validating models...
0 errors found.

Django version 0.97-pre, using settings 'michilu_trunk.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

#### Python 2.4 + Django 0.96 + michilu.com branche
$ cd ../
$ rm michilu
$ ln -s michilu_branche michilu
$ cd michilu
$ ./manage.py runserver
Validating models...
0 errors found.

Django version 0.96, using settings 'michilu_branche.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

シンボリックリンクだらけだな。。

Thu, 12 Jul 2007 20:04:17 +0900 source edit
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.1 Japan License.
View All Posts. MiCHiLU.com powered by Django ;-)