Skip to content
Find out who your local ward councillor is
Python HTML CSS JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Local is Code for SA's set of Django applications for helping users find data local to them.

Included apps:

Data Sources

This app loads data from the IEC's API ( and supplements it with data from the Google Sheet at

The data from the IEC is cached in a local database cache and is used only if the IEC server is down.

Local development

  1. clone the repo
  2. cd nearby
  3. virtualenv --no-site-packages env
  4. pip install -r requirements.txt

You will need to set some environment variables, which are in the Nearby projects folder on Google Drive. The GOOGLE_SHEETS_API_KEY is big, the simplest way to handle it is to download it into a local file.

export IEC_API_USERNAME=the-username
export IEC_API_PASSWORD=the-password
export GOOGLE_SHEETS_EMAIL=the-email
export GOOGLE_SHEETS_PRIVATE_KEY=`cat google-sheets-key.txt`

Then setup the database and run the server:

python createcachetable
python runserver

Production deployment

Production deployment assumes you're running on Heroku.

You will need:

heroku create
heroku addons:add heroku-postgresql
heroku config:set DJANGO_DEBUG=false \
                  DISABLE_COLLECTSTATIC=1 \
                  DJANGO_SECRET_KEY=some-secret-key \
                  NEW_RELIC_APP_NAME=cool app name \
                  NEW_RELIC_LICENSE_KEY=new relic license key \
                  IEC_API_USERNAME=the-username \
                  IEC_API_PASSWORD=the-password \
                  GOOGLE_SHEETS_EMAIL=google sheets user email \
git push heroku master


MIT License

You can’t perform that action at this time.