(djtweet)hdknr@deblen:~/.ve/djtweet/src$ tree -d .
.
|— djcube
| |— djcube
| |— djcube.egg-info
| |— php
| | `— promocode
| |— sample
| `— website
| |— apache
| | `— cache
| | `— MySQL_python-1.2.3c1-py2.5-linux-i686.egg-tmp
| `— promocode
|— djtweet
| `— website
| |— atompub
| |— diary
| `— tweets
| |— fixtures
| |— sql
| |— temp
| `— xslt
|— enablr
| |— enablr
| `— enablr.egg-info
`— mysite 24 directories の環境で、djtweetを実行すると、 (djtweet)hdknr@deblen:~/.ve/djtweet/src/djtweet/website$ python manage.py shell
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
(InteractiveConsole)
»> from website.settings import *
»> DATABASE_NAME
‘djcube’
となって、別の環境が読み込まれてしまう。 これは、djcubeもdjtweetもsetup.py でvirtualenvにインストールしているので、 »> import sys
»> for x in [ x for x in sys.path if x.startswith(‘/home’)]:
… print x
…
/home/hdknr/.ve/djtweet/src/djtweet/website
/home/hdknr/.ve/djtweet/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg
/home/hdknr/.ve/djtweet/lib/python2.5/site-packages/pip-0.6.3-py2.5.egg
/home/hdknr/.ve/djtweet/lib/python2.5/site-packages/MySQL_python-1.2.3c1-py2.5-linux-i686.egg
/home/hdknr/.ve/djtweet/src/enablr
/home/hdknr/.ve/djtweet/src/djcube
/home/hdknr/.ve/djtweet/lib/python2.5
/home/hdknr/.ve/djtweet/lib/python2.5/plat-linux2
/home/hdknr/.ve/djtweet/lib/python2.5/lib-tk
/home/hdknr/.ve/djtweet/lib/python2.5/lib-dynload
/home/hdknr/.ve/djtweet/lib/python2.5/site-packages となって別のアプリケーションも環境に含まれてしまっているから。
なので、djcube/website ではなくて、djcube/website/app とかにして1つディレクトリかました方がいいな。
Posted via email from 原宿工業大学 | Comment »