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'