Setup python django postgresql di macosx dengan brew

Table of Contents

1 Install Xcode dan Homebrew

xcode-select --install

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Tambahkan baris berikut di ~.bash_profile

export PATH=/usr/local/bin:$PATH

Cari path ke python dengan mengetik:

which python

Output harusnya /usr/bin/python (path lawas).

Sekarang install python yang baru:

which python

Output yang baru: /usr/local/bin/python.

Tambahkan ke ~/.bash_profile:

export PATH=/usr/local/share/python:$PATH

Sekarang install virtualenv:

pip install virtualenv

Coba buat /virtual environment baru:

mkdir myvenv
cd myvenv
virtualenv .
. bin/activate

Done!

2 Install postgresql

Steps:

brew install postgresql

Start postgresql service

brew services start postgresql

Create postgres user

createuser --pwprompt postgres

Create dbase

createdb 'agcimg2'

Date: <2016-09-01 Thu>

Author: Kholid Fuadi

Created: 2016-09-01 Thu 12:51

Emacs 24.5.1 (Org mode 8.2.10)

Validate