Skip to content
Henry Mehta edited this page Oct 16, 2024 · 6 revisions

Instructions for getting web-cdi to work locally

Locally, the site is run under docker. Within web-cdi main directory create an .env file. There are a number of settings you want here which are read by webcdi/settings.py. Refer to this page and add variables as required.

Run locally by building the environment with docker-compose build. Then run docker-compose run web python manage.py collectstatic (note: this is required even in DEBUG mode for ckeditor and some of the data files used in the templates).

docker-compose run web ./manage.py migrate
docker-compose run web ./manage.py collectstatic --noinput
docker-compose run web ./manage.py 01_populate_instrument_family
docker-compose run web ./manage.py 02_populate_instrument
docker-compose run web ./manage.py 03_populate_scoring
docker-compose run web ./manage.py 04_populate_benchmark
docker-compose rum web ./manage.py 05_populate_choices
docker-compose run web ./manage.py 06_populate_items

    docker-compose run web ./manage.py createsuperuser

Finally, run docker-compose up and login with the superuser credentials you gave

Using Existing WebCDI database

If you have access to an existing WebCDI database and want to take a copy of it and use you can simply dump the existing database and load it to your Postgres database then provide the credentials to DATABASES in secret_settings.py.

Your commands will be something like

pg_dump -h [dev db hostname from databases.py] -p 5432 -U [db user] [db name] > file.sql

psql -h localhost -d [db name] -U [db user] -f file.sql