$ git clone https://github.com/uktrade/directory-ui-supplier
$ cd directory-ui-supplier
$ virtualenv .venv -p python3.6
$ source .venv/bin/activate
$ pip install -r requirements_text.txt
Secrets such as API keys and environment specific configurations are placed in conf/.env
- a file that is not added to version control. You will need to create that file locally in order for the project to run.
Here are the env vars to get you going:
DIRECTORY_FORMS_API_API_KEY=debug
DIRECTORY_FORMS_API_SENDER_ID=debug
Form submissions are powered by directory-forms-api. Set that up locally then generate a API client here and add the values to env vars to conf/.env
.
$ make debug_webserver
$ make debug_test
If you're doing front-end development work you will need to be able to compile the SASS to CSS. For this you need:
$ npm install yarn
$ yarn install --production=false
We add compiled CSS files to version control. This will sometimes result in conflicts if multiple developers are working on the same SASS files. However, by adding the compiled CSS to version control we avoid having to install node, npm, node-sass, etc to non-development machines.
You should not edit CSS files directly, instead edit their SCSS counterparts.
$ gulp make compile_css
Signed cookies are used as the session backend to avoid using a database. We therefore must avoid storing non-trivial data in the session, because the browser will be exposed to the data.
Follow the Django documentation.
To create or update .po
files:
$ make debug_manage cmd="makemessages"
To compile .mo
files (no need to add these to source code, as this is done automatically during build):
$ make debug_manage cmd="compilemessages"
https://github.com/uktrade?q=directory https://github.com/uktrade?q=great