-
Clone the repo and
cd
into the directory.git clone https://github.com/opendifferentialprivacy/opendp-ux.git && cd opendp-ux
-
Tell Docker to turn on the webserver and database:
docker-compose up
If major configuration changes have been made (new dependencies, etc.) then the containers will need to be rebuilt:
docker-compose up --rebuild
-
All subsequent commands should be run from the
server
directorycd server
-
The first time you run (or anytime schema changes have been made) you need to run migrate manually:
docker-compose run server ./migrate.sh
(In general, any command can be run by adding "docker-compose run server" to the beginning, such as:
docker-compose run server python manage.py shell
which will drop you into the Django shell on the Docker container.)
- Clone the repo and
cd
into the directory.git clone https://github.com/opendifferentialprivacy/opendp-ux.git && cd opendp-ux
- Create virtual environment:
python3 -m venv venv
- Activate virtual environment:
. venv/bin/activate
- Install requirements:
pip install -r requirements.txt
- Ensure latest version of npm:
npm install -g npm@latest
- Install Vue.js project dependencies:
cd opendp-ux/client && npm install
- Run the Vue.js dev server:
cd opendp-ux/client && npm run serve
- build for production:
npm run build
- build for production:
cd server/
- First time, run migrations:
python manage.py migrate
- Run Django dev server:
python manage.py runserver
- Open
http://127.0.0.1:8000/
in your browser.
- Follow steps 1-5 under Running, above
- Open
http://127.0.0.1:8000/api/
in your browser.
- Access your command-line terminal
- Issue a HTTP command for the API area of interest. This example uses curl to issue the HTTP command. Note that the port you specify should match the port in the output of step 5 under Running, above
curl http://127.0.0.1:8000/api/
curl http://127.0.0.1:8000/api/users/
(This is based on an existing project by EugeneDae. See his project for original documentation.)
- Create a Python virtualenv to set up your environment
python3 -m venv venv
- Install PyDotPlus
pip install pydotplus
- Install Django Extensions
pip install django-extensions
- Configure your Django project to use Django Extensions in settings.py under
server/opendp-projects/
INSTALLED_APPS = (
...
'django_extensions',
...
)
- Invoke Django manager with graph models option, from the server/ subdirectory
python manage.py graph_models -a -o opendpapp_models.png
- Use a browser or viewer to view the created png file, found in the
server/
subdirectory
(This is based on an existing project by EugeneDae. See his project for original documentation.)