Skip to content

Dev Install

paigewilliams edited this page Feb 11, 2026 · 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

Boot and log in to the VM:

vagrant up
vagrant ssh

Installation on your VM:

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

DJ Alias:

sudo vim ~/.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:

sudo -u postgres createdb bluepages
sudo vim /etc/postgresql/16/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

If you have a SQL dump to start from:

sudo -u postgres psql bluepages < /PATH/TO/YOUR/DUMP.sql

Else:

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

Run Dev Application

First, create and update your local settings:

cp /usr/local/apps/wcbluepages/bluepages/bluepages/local_settings.py.template /usr/local/apps/wcbluepages/bluepages/bluepages/local_settings.py
vim /usr/local/apps/wcbluepages/bluepages/bluepages/local_settings.py
  • Remove the DATABASES section
  • Ensure DEBUG = True
  • Save

Now you can run the Django Dev Server:

djrun

You should see your site at http://localhost:8000

Building Javascript with Node.js

If you edit any javascript, you will need to build new minified files. Before you can build, you will need to use npm to install the dependencies for each of your javascript modules. Once you've run your installation your first time, you should be able to just 'build' afterward.

Prerequisite:

sudo apt install npm

To install on your VM

cd /usr/local/apps/wcbluepages/bluepages/app/static/app/js/
npm run install

To build on your VM

cd /usr/local/apps/wcbluepages/bluepages/app/static/app/js/
npm run build

Clone this wiki locally