virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
You also need to trust the SSL certificate in ssl/localhost.crt. Even better is to replace it with your own. The procedure for generating a self-signed certificate is readily available on-line.
The OpenID Connect Client Manager can be found in the Collaboratory at this url:
https://collab.humanbrainproject.eu/#/collab/54/nav/1051
When configuring you test client.
- Pick a meaningful name (probably something related to your App name)
- Select 'Server flow' application type
- Add to 'Authorized redirect URL' a local testing url:
https://localhost:8000/complete/hbp/
- Ensure that the scopes hbp.collab, hbp.document and hbp.notification.self are checked.
- Save your client registration
Save the "Client ID" and "Client Secret" values for the next step.
Copy .env-sample to .env
Replace SECRET_KEY with the output of the following command:
OSX:
date | md5
Linux or Cygwin:
date | md5sum
Replace HBP_OIDC_CLIENT*
with the data collected from the OpenID Connect Client Manager in the previous step.
cp .env-sample .env
You can now run the migration in order to bootstrap the database.
python manage.py migrate
You can then start the server
python manage.py runsslserver --certificate=ssl/localhost.crt --key=ssl/localhost.key
From another terminal open an example URL to test your new app:
OSX:
open https://localhost:8000?ctx=2BB5C05D-C417-4ED7-8D4D-C4F940DA8328
Linux:
xdg-open https://localhost:8000?ctx=2BB5C05D-C417-4ED7-8D4D-C4F940DA8328