Follow these steps to install distribution-viewer locally:
- Install any of the following that are not installed already
- git
- npm
- pip
- postgres
- python
- virtualenv
git clone https://github.com/mozilla/distribution-viewer.git
cd distribution-viewer
echo DEBUG=True >> .env
virtualenv env
source env/bin/activate
pip install -r requirements.txt
npm install
npm install -g gulp
- Start PostgreSQL
- Mac:
brew services start postgresql
(seebrew info postgresql
for more info)
- Mac:
- Set up the database
- Create a new user with name distributionviewer and password
distributionviewer
- Mac:
createuser --pwprompt distributionviewer
- Mac:
- Create a new database named distributionviewer that the
distributionviewer user has read/write access to
- Mac:
createdb -Odistributionviewer -Eutf8 distributionviewer
- Mac:
- Give the user distributionviewer access to create new tables (needed to
run tests later)
- Mac:
psql -c "ALTER USER distributionviewer CREATEDB" postgres
- Mac:
- Create a new user with name distributionviewer and password
distributionviewer
- Start PostgreSQL
- If you just finished the install instructions or if you ran
brew services start postgresql
at any point in the past, PostgreSQL should already be running
- If you just finished the install instructions or if you ran
source env/bin/activate
./manage.py runserver
- In another terminal:
gulp serve:api
- In another terminal:
gulp watch
- Load 127.0.0.1:8000
New dependencies will need to be installed from time to time. Run the following if you see an error about a missing or out-of-date dependency:
pip install -U -r requirements.txt
npm install
./manage.py test
gulp test