-
Notifications
You must be signed in to change notification settings - Fork 0
Dev Install
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
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
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
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
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
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.
sudo apt install npm
cd /usr/local/apps/wcbluepages/bluepages/app/static/app/js/
npm run install
cd /usr/local/apps/wcbluepages/bluepages/app/static/app/js/
npm run build