Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Land Registry service for Land Availability Tool

License

Notifications You must be signed in to change notification settings

alphagov/land-availability-lr

Repository files navigation

land-availability-lr

Land Registry service for Land Availability Tool

Continuous integration status

Travis-CI Status codecov

PostgreSQL Setup

Make sure you have PostgreSQL (tested with 9.6) installed.

It's strongly suggested to use Postgres.app on OSX and to install all the other tools and dependencies using brew.

Create DB

createdb landavailability-lr

Project Configuration

Make sure you have this environment variable set:

DATABASE_URL=postgres://USERNAME:PASSWORD@HOST:PORT/DBNAME
SECRET_KEY=abcd1234

example:

DATABASE_URL=postgres://andreagrandi@localhost:5432/landavailability-lr
SECRET_KEY=abcd1234

If you are using a Python virtual environment, you can save these values in $venv_folder/bin/postactivate script:

export DATABASE_URL=postgres://andreagrandi@localhost:5432/landavailability-lr
export SECRET_KEY=abcd1234

Make sure the correct Heroku buildpacks are set:

heroku buildpacks:set https://github.com/cyberdelia/heroku-geo-buildpack.git
heroku buildpacks:set heroku/python

Dump DB

You may need a newer version of psql - it must be the same or newer than the postgres version of the db. To get psql 9.6 on Ubuntu 16.04:

sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-9.6

To do the dump:

pg_dump -W -h <db-host> -p 5432 -d landavailability-lr -U landavailability -F c -b -v -f lr.pg_dump

Restore DB onto Heroku

To restore a database onto Heroku:

heroku pg:backups:restore --app land-availability-lr '<s3-url>' DATABASE_URL

About

Land Registry service for Land Availability Tool

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages