Performance Platform admin is a Flask app that allows authorised users to update performance data on GOV.UK.
We recommend using virtualenv to manage this application's dependencies. If you are using the performance platform development VM, run workon performanceplatform-admin
to source this.
To set up, run:
pip install -r requirements.txt
Redis is also required to run the application. It is already on the dev vm. If you prefer to install it locally:
brew install redis
To start run redis-server
While the default command is enough to run the app locally, a good guide to adding redis to launchctl can be found here if you're more ambitious.
If you're running this in dev, an additional route '/sign-in' is available to bypass authing with signon.
- Create a signon application and user
- Update development config with OAuth2 credentials
- Set an environment variable to allow OAuth over insecure TLS in development:
export OAUTHLIB_INSECURE_TRANSPORT=1
- Run the app as normal
If you need to compile stylesheets outside of the normal app starting process then run:
python tools/compile_sass.py
This app expects two environment variables to be set: PORT
and REDIS_URL
.
Redis needs to be running when booting the app locally.
export PORT=3070
export REDIS_URL=redis://localhost:6379/12
python start.py
or if you're using the Performance Platform development environment you can
bowl admin
Starting the app in development will automatically compile stylesheets.
You can modify your local configuration without affecting version control using
the instructions in the admin/config/development.py
file.
Redis needs to be running before starting the tests.
./run_tests.sh
Clone the stagecraft repo then from that folder, run:
bash tools/replicate-db.sh api-postgresql-primary-1.api.integration govuk_dev