"Return To Office" is a system used to manage people booking desks for safely returning to the office. The live URL is https://return-to-office.trade.gov.uk/.
A local virtualenv is needed for a few reasons:
- To be able to run the pre-commit checks
- If using an IDE, so it has access to the library code and tooling
Note that the application is never actually run on the local machine while developing, only within Docker.
cp sample.env .env
- Only the
AUTHBROKER_XXX
env variables are required to run the project locally - You can copy the
AUTHBROKER_XXX
values from Vaultdit/platform/return-to-office/dev
- Then replace all values of ASK-SOMEBODY in
.env
with the real values
- Only the
make build
- Build all Docker containers
npm install
make setup
- Create local virtualenv, set up pre-commit hooks, initialize database
Start everything using docker-compose: make up
Go to http://localhost:8000 and use your DIT Google account to log in.
Make sure to rebuild the Docker images if new dependencies are added to the
requirements files: make build
.
After you login for the first time, do this to give yourself superuser access:
$ make shell
import custom_usermodel
me = custom_usermodel.models.User.objects.first()
me.is_staff = True
me.is_superuser = True
me.save()
return-to-office uses Black for code formatting and flake8 for code analysis. Useful commands:
make black
- Check code is formatted correctlymake black_format
- Reformat all codemake flake8
- Check code quality is up to scratch