Create a virtualenv (e.g python 3.8) then install dependencies with pip $ virtualenv --python=python3.8 $ source .env/bin/activate $ pip install -r requirements.txt
There is an example run script in the ./scripts directory which shows how to configure the app
export SYNCHWEB_HOST=<SynchWeb address: e.g. https://ispyb.diamond.ac.uk/ >
export ISPYB_CONFIG_FILE=<path to credentials file>
export ISPYB_CONFIG_SECTION=<section name in file (e.g. ispyb_prod)>
Format of the .cfg file is as specified by ispyb-python-api
Example in tests/test.cfg
export FLASK_APP=app.py
export FLASK_ENV=development | production
$ flask run --host <ip addr> --port <port>
There is no application level authentication here It's designed to work with nginx to control access
This app uses a fraction of the ISPyB database tables If core tables have changed (Dewar, DewarTransportHistory, BLSession, Proposal, Person, Shipping etc.) the models file might need to be re-generated.
To update the models within the ispyb_api package run: $ python -m scripts/generate_models
This will create a './scripts/automodels.py' file
The script output will show if the file differs from ispyb_api/models.py
If it does, integrate changes or copy the ./scripts/automodels.py file across to the ispyb_api/models.py