- Install and log into the local heroku tools: https://toolbelt.heroku.com/
- Create a virtual environment with Python 3 (
virtualenv -p python3 env
) and activate it (source ./env/bin/activate
) - Within your virtualenv install all required dependencies (
pip install -r requirements.txt
) - Copy
default.env
to.env
, to set up default local environmental variables (cp default.env .env
)
- You may want to set up a your own github application (with callback url http://localhost:5000/complete/github) and copy the id and secret into this if you want local github auth
- Start a local postgres server, with passwordless login for the 'postgres' user (e.g.
docker run --rm -p 5432:5432 postgres
) - Create a 'speakers' database on that server (
psql -h localhost -p 5432 --user postgres -c "CREATE DATABASE speakers"
) - Run the migrations (
python manage.py migrate
) - Start the app with foreman (
foreman start
) - Go to localhost:5000 to see the site
Heroku have their own article on doing this generally.
A specific example is always nice though:
heroku pg:backups capture
curl -o latest.dump `heroku pg:backups public-url`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d speakers latest.dump