This tool calculates values based on Cal-B/C workbooks. It also provides automation around filling out workbooks.
Note
All commands below should be run inside this directory.
This application requires uv to be installed. This can be installed using asdf:
$ asdf plugin add uv
$ asdf installInstall dependencies using uv:
$ uv syncCopy .env.example to .env and fill in the secret values in the .env file:
$ cp .env.example .envSet your Google Cloud project and login:
$ gcloud config set project cal-itp-data-infra-staging # you will want to unset this later with `gcloud config unset project`
$ gcloud auth application-default login --login-config=iac/login.json --quietCreate the database and run migrations:
$ uv run manage.py sqlcreate | psql
$ uv run manage.py migrateNote
If you don't have postgresql, run brew install postgresql or visit https://www.postgresql.org/ for more information.
If you run into the error database "database_name" does not exist, you may need to create it manually running createdb <database_name>.
To check if your database was created, run psql -l.
In another terminal tab, start the Tailwind build process:
$ uv run manage.py tailwind build
$ uv run manage.py tailwind watchThen, collect all the static files and start the Django server:
$ uv run manage.py collectstatic
$ uv run manage.py runserverNow, visit the server at http://localhost:8000.
In order to run tests, you will need to ensure that Playwright is installed:
$ uv run playwright installNow, run the tests:
$ uv run manage.py testNote
You can run only the web application tests using:
$ uv run manage.py test tests/cal_bcThis project uses ruff to lint code. To run linting and apply fixes:
$ uv run ruff check --fixIn order to access the admin site at http://localhost:8000/admin, you need to create a superuser for your DOT login:
$ uv run manage.py createsuperuser
Username (leave blank to use 'yourname'): Your.Name@dot.ca.gov
Email address: Your.Name@dot.ca.gov
Password: ********
Password (again): ********Now, when you visit the admin site, you can log in with your DOT account as usual.
Note
If you forget to add your user before this point, the Azure Entra ID login package will automatically add a user and disallow access. You will need to either manually make your user a superuser or delete your user account.
This tool is licensed under the terms of the GNU Affero General Public License.