Skip to content


Repository files navigation

GrantNav - Explore Grants in the 360 data standard

Build Status

We use GitHub Projects to provide a Kanban board visualisation of our workflow and issues


This is a search tool for data in the 360 giving data format.

Live deploy at


This application is built using Django, Elasticsearch and python 3


Steps to installation:

  • Install pre-requisites: Git, Python3, and lots of things for Pillow.
  • Clone the repository
  • Change into the cloned repository
  • Create a virtual environment
  • Activate the virtual environment
  • Install dependencies
  • Install Elastic search
  • Run database migrations
  • Run the development server

These instructions assume Ubuntu Xenial.

sudo apt-get install -y git-core
sudo apt-get install -y python3-dev

git clone
cd grantnav
python3 -m venv .ve
source .ve/bin/activate
# Make sure you have a recent version of pip, to install binary wheel packages.
pip install --upgrade pip
pip install -r requirements.txt # Use requirements_dev.txt if you're installing for development.
# Elasticsearch 7
wget -qO - | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install elasticsearch
sudo service elasticsearch start
python migrate
# Running the tests gets some data into the elastic index
python runserver

Note that if you are not on Debian based system you will need to follow to install elasticsearch. Follow the instructions in your terminal to open the aplication in your browser.


The default django database is used in grantnav to manage user session preferences data. It must be created via the setup migrate for GrantNav to work correctly.

note: This is not related to elasticsearch.

Accessing GrantNav

The above command gives you a local server listening on port 8000. If you're installing inside a virtual machine, you will need to do some or all of the following:

  1. Modify or disable the firewall to allow connections. (sudo ufw disable)
  2. Set the ALLOWED_HOSTS environment variable to include your host IP: export ALLOWED_HOSTS='localhost','',''
  3. Modify your VM settings to allow port forwarding. E.g.: "private_network", ip: "" in Vagrant.
  4. Start the server with the allowed host: python runserver

Loading Data

In order to load some data use the dataload/ command line tool e.g:

python dataload/ --clean filename1.csv filename2.csv *.json

The clean command is optional; it will delete the index and start again, so leave it off if you want to add just another file to an existing index. You can specify as many file or patterns as you like at the end of the command.

The funders and recipients search requires the datastore generated funders.jl and recipients.jl files to be passed in as arguments to import_to_elasticsearch via the commands --funders path/to/funders.jl and --recipients path/to/recipients.jl.

Getting data for loading

There is a list of 360Giving datasets at There's an API for this list and a datagetter tool to download and convert it -

If your data is in a flat format (eg Excel spreadsheet, CSV), or needs validating, you can use CoVE to convert and validate your data.

Alternatively contact 360Giving for the latest data dump from the datastore.

Provenance JSON

Most parts of GrantNav work fine without provenance information. However, in order for the publisher/datasets pages to work correctly you must point the PROVENANCE_JSON environment variable at a local copy of data.json. You must also load the data into GrantNav using filenames that correspond to the identifiers in this JSON. The datagetter saves files with the correct name, and also makes a copy of data.json for you.


cd datagetter/data/json_acceptable_license_valid
python path/to/grantnav/dataload/ --clean *
cd path/to/grantnav
PROVENANCE_JSON=path/to/datagetter/data/data_acceptable_license_valid.json python runserver

Compile theme

In order to compile the sass theme please see the 360-ds submodule. All styles are built and imported from there.

Run tests

ALLOWED_HOSTS=localhost py.test

Make sure elastic search is running.

The tests include functional tests (actually interacting with the website in selenium). These can also be run against a deployed copy of the website:


The tests delete an elastic search index and repopulate it. The default index name is threesixtygiving

We also use flake8 to test code quality, see

We use ESLint to statically analyse JavaScript code.

  • Install with npm install
  • Run npx eslint --ext .js --ext .html grantnav/frontend/templates/**

Adding and updating requirements

Add new requirements to or depending on whether it is just a development requirement or not. Run pip-compile (from the package pip-tools) on the ".in" file.