- cd ~/
- sudo easy_install virtualenv
- sudo virtualenv env
- source env/bin/activate
- git clone git@github.com/DgFutureLab/satoyama-api.git
- cd satoyama-api/
- pip install -r requirements.txt
- brew install postgresql
- postgres -D /usr/local/var/postgres
- Make postgresql run everytime:
mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents homebrew.mxcl.postgresql.plist
-
psql postgres (To get inside the postgres database console)
-
create role satoyama with login superuser;
-
alter role satoyama with password 'satoyama';
(Optional: create database your-macosx-username , this step will allow you to login to postgres just using “psql” instead of “psql postgres”)
-
create database satoyama_prod;
-
create database satoyama_dev;
-
create database satoyama_test;
-
\q
(Optional: \l to list the the databases)
-
cp db_config_sample.yml db_config.yml
-
Replace the values of “username” and “password” with the ones you have setup on the previous steps. If you have used the default values when creating the psql database and roles you can leave you can skip this step.
-
python migrate_dev.py db upgrade (creates database schema)
-
python run_webserver.py --env development
-
load http://127.0.0.1:8080 on your browser