一、装pip
sudo easy_install pip
二、装mezzanine
pip install mezzanine
三、装brew,具体信息看这里http://brew.sh/index_zh-cn.html
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
四、装postgres
brew install postgresql -v
接下来就是初始数据库,指定 "/usr/local/var/postgres" 为 PostgreSQL 的配置数据存放目录,并且设置数据库数据编码是 utf8
启动 PostgreSQL:
关闭 PostgreSQL:
initdb /usr/local/var/postgres -E utf8
设成开机启动 PostgreSQL:ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl -D /usr/local/var/postgres stop -s -m fast
五、装psycopg2sudo pip install psycopg2
六、测试一下是否ok
>>> import django
>>> django.VERSION
(1, 9, 1, 'final', 0)
>>> import psycopg2
>>> psycopg2
<module 'psycopg2' from '/Library/Python/2.7/site-packages/psycopg2/__init__.pyc'>
>>>