Skip to content
Repository for the housing team 2019 API app.
JavaScript CSS Python Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hackoregon_housing
local_settings change card-one endpoint name to portland-metro-tract-population-by-race Aug 29, 2019
requirements
scripts bring api up to current deployment state Aug 25, 2019
staticfiles
tests
.cookiecutter.json
.coveragerc bring api up to current deployment state Aug 25, 2019
.dockerignore add .dockerignore (copied from transportation backend) Aug 24, 2019
.gitignore bring api up to current deployment state Aug 25, 2019
.travis.yml bring api up to current deployment state Aug 25, 2019
2019-housing-backend.code-workspace
DOCKERFILE
LICENSE
MANIFEST.in
Makefile bring api up to current deployment state Aug 25, 2019
README.md bring api up to current deployment state Aug 25, 2019
docker-compose.yml bring api up to current deployment state Aug 25, 2019
env.sample adding cookiecutter template in Jun 28, 2019
pytest.ini adding cookiecutter template in Jun 28, 2019

README.md

hackoregon_housing

PyPI version | Build Status

This projects maps the state of the housing market in Oregon using data from Harvard Joint Center for Housing Studies, Neighborhood Change Database, and Home Mortgage Disclosure Act data.

Documentation

The full documentation is at http://hackoregon.github.io/2019-housing-backend

Features

  • TODO (add what your project does)

Data Sources

This API package in this repo is based on the Data Science work in the following projects:

Quickstart to install package in your own Django Project (Non-Hack Oregon Workflow)

  • Install hackoregon_housing:
    pip install hackoregon_housing

  • Add subpackages to your INSTALLED_APPS:

    INSTALLED_APPS = [     
                        ...     
                        'api',     
                        ...
                      ]
  • Add hackoregon_housing's URL patterns:

    from hackoregon_housing.api
    import urls as api_urls   
    
    urlpatterns = [     
                    ...     
                    url(r'^', include(api_urls)),     
                    ...
                  ]
  • Setup your database with a matching schema

  • Run the project

Running Tests

This repo uses pytest and pytest-django to run tests.

For project development work, tests will be run in docker container using the bin/test.sh script:

Deployment

This repo is intended to be used in conjunction with a Travis CI based automated deploy chain to push projects to an AWS Fargate cluster

Prerequisites:

  • bumpversion - install on local computer, used for version management

Basic Steps:

  1. Branches can be pushed/merged in Github. Automated tests will be run. Unless a tagged push is made, app will not deploy

  2. When ready to deploy a new version, you'll confirm you have merged all latest code into your deployment branch (perhaps master?) and have this pulled to your local computer

  3. Create a tagged commit using bumpversion, following semantic versioning: v[major].[minor].[patch]

Lets take an example: If the current version was v1.10.4 and you wanted to update the minor portion (ie: a non-breaking but significant change), you will run the following command:

bumpversion minor --config-file ./hackoregon_housing/setup.cfg

this would then update the version to v1.11.0

to then create a patch update,

bumpversion patch --config-file ./hackoregon_housing/setup.cfg

Version will then become: v1.11.1

In the background - bumpversion checks in the setup.cfg file for any bumpversion:file entries for which to regex for the version tag syntax, which in this case is the VERSION file which contains the current version. Bumpversion then looks at the part you specify and updates that portion accordingly

Additionally and importantly for the deploy chain, it will also add a git tag with the version number.

  1. Once you have created the new tagged version of your repo, you can go ahead and push a tagged release to github:
git push origin <version-tag>
  1. Once you push this, Travis should run through it's testing/build cycle and then provided necessary env variables are configured in Travis and AWS services, deploy to the cloud.

Credits

Tools used in rendering this package:

You can’t perform that action at this time.