How to integrate with TOM Toolkit
This assumes that you know how to run a TOM server/site using the TOM Toolkit.
Clone this repo and put the directory on your path. (
git clone https://github.com/mwvgroup/tom_pittgoogle.git)Add Pitt-Google to your TOM. Follow the TOM Toolkit instructions in the section Using Our New Alert Broker. Our modules were written following the instructions preceding that section.
In your
settings.pyfile:Add these to the
TOM_ALERT_CLASSESlist:'tom_pittgoogle.broker_stream_rest.BrokerStreamRest', 'tom_pittgoogle.broker_stream_python.BrokerStreamPython', 'tom_pittgoogle.broker_database_python.BrokerDatabasePython',
Add these additional settings:
# see the Authentication docs for more info GOOGLE_CLOUD_PROJECT = "pitt-broker-user-project" # user's project PITTGOOGLE_OAUTH_CLIENT_ID = os.getenv("PITTGOOGLE_OAUTH_CLIENT_ID") PITTGOOGLE_OAUTH_CLIENT_SECRET = os.getenv("PITTGOOGLE_OAUTH_CLIENT_SECRET")
After running
makemigrations, etc. and authenticating yourself, navigate to the “Alerts” page on your TOM site. You should see three new broker options corresponding to the three Pitt-Google classes you added to theTOM_ALERT_CLASSESlist.