Quick Start

Install

Install from GitHub:

$ pip install git+https://github.com/UW-GAC/django-anvil-consortium-manager.git

Configure

You will need a service account credentials file that is registered with Terra. XXX Get info from Ben about this.

Settings

  1. Add anvil_consortium_manager to your INSTALLED_APPS.

INSTALLED_APPS = [
    # ...
    "anvil_consortium_manager",
]

If you would like to use the views and templates provided by the app, then you should also install django-tables2 in your project.

  1. Set the ANVIL_API_SERVICE_ACCOUNT_FILE setting to the path to the service account credentials file.

ANVIL_API_SERVICE_ACCOUNT_FILE="/<path>/<to>/<service_account>.json"

Alternatively, if you would like to browse the app without making any API, just set this to a random string (e.g., "foo").

  1. Set the default workspace type in your settings file.

ANVIL_WORKSPACE_ADAPTERS=["anvil_consortium_manager.adapters.default.DefaultWorkspaceAdapter"]

See the Advanced Usage section for information about customized workspace types.

  1. If you would like to use the templates provided with the app, add the "anvil_consortium_manager.context_processors.workspace_adapter" context processor to your settings file. This allows the templates to know about which types of workspace adapters that are registered (step 3), and then display links to the correct URLs.

  2. Add account linking settings to your settings file.

# Specify the URL name that AccountLink and AccountLinkVerify redirect to.
ANVIL_ACCOUNT_LINK_REDIRECT = "home"
# Specify the subject for AnVIL account verification emails.
ANVIL_ACCOUNT_LINK_EMAIL_SUBJECT = "Verify your AnVIL account email"

Optional settings

If you would like to receive emails when a user links their account, set the ANVIL_ACCOUNT_VERIFY_NOTIFICATION_EMAIL setting in your settings file.

ANVIL_ACCOUNT_VERIFY_NOTIFICATION_EMAIL = "to@example.com"

Permissions

The app provides two different permissions settings.

  1. anvil_project_manager_view - users with this permission can view information, for example lists of users or workspace details.

  2. anvil_project_manager_edit - users with this permission can add, delete, or edit models, for example import an account from AnVIL or create a workspace.

We suggest creating two groups, viewers (with anvil_project_manager_view permission) and editors (with both anvil_project_manager_view and anvil_project_manager_edit permission). Users can then be added to the appropriate group. Note that users with edit permission but not view permission will not be able to see lists or detail pages, so anyone granted edit permission should also be granted view permission.