Skip to content

Dev Install

David Pollard edited this page Jul 28, 2022 · 13 revisions

Host Preparation:

You will need to install:

  • Vagrant
  • Git

CD into whatever directory you like to code from, then clone the project.

git clone https://github.com/Ecotrust/wcbluepages.git
cd ./wcbluepages

Decide if you want to use Ubuntu 20.04 (Focal) or 22.04 (Jammy). For now we'll use Focal since Jammy does not allow rsa auth by default, but we'd need to configure vagrant to support something else. If NOT using Focal (20.04) you'll need to change which line of installing postgres/postGIS is commented out in ./deploy/linux_deps.sh

Boot and log in to the VM:

vagrant up
vagrant ssh

Installation on your VM:

cd /usr/local/apps/wcbluepages/deploy/
sudo ./linux_deps.sh
./linux_pyenv.sh
source /usr/local/apps/env/bin/activate

DJ Alias:

sudo vim /etc/bash.bashrc

Add the following lines to the bottom:

alias dj="/usr/local/apps/env/bin/python /usr/local/apps/wcbluepages/bluepages/manage.py"
alias djrun="dj runserver 0.0.0.0:8000"

To use the newly added alias you must exit your VM:

ctrl+d

Then SSH back in:

vagrant ssh

Database:

Create the DB ('12' for 20.04 Focal -- use '14' below for 22.04 Jammy):

sudo -u postgres createdb bluepages
sudo vim /etc/postgresql/12/main/pg_hba.conf

Edit the config so that the first uncommented line (near the bottom) has the method 'trust':

local   all             postgres                                trust

Restart Postgres, then apply the database migrations

sudo service postgresql restart
dj migrate
dj createsuperuser
dj loaddata /usr/local/apps/wcbluepages/bluepages/address/fixtures/initial.json
dj loaddata /usr/local/apps/wcbluepages/bluepages/app/fixtures/initial.json

Clone this wiki locally