commonknowledge / vent-your-rent

Share your story of the renter crisis
https://ventyour.rent
Other
5 stars 1 forks source link

Vent Your Rent

Renters vent about their conditions and sign up to the Renters Manifesto

Built with Cookiecutter
Django

Black code
style

Vent Your Rent has two components, a backend and a frontend. The backend Django application providing an adminstration interface and a GraphQL endpoint. The frontend is a React application which can be found in the frontend/ directory of this repository.

Local Development

Quick start

Install and run the frontend in one terminal:

cd frontend && yarn && yarn graphql:generate-types && yarn start

In another terminal, back at the root (cd ../), set up and run the django server.

yarn containercmd django python manage.py createsuperuser
yarn dev

Requirements

For detailed information see https://cookiecutter-django.readthedocs.io/en/latest/developing-locally-docker.html

Management Commands

Django management commands can be run using docker-compose run:

$ docker-compose -f local.yml run --rm django python manage.py
$ docker-compose -f local.yml run --rm django python manage.py migrate

Setting Up Your Users

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type checks

Running type checks with mypy:

$ docker-compose -f local.yml run --rm  django mypy vent_your_rent

Test coverage

To run the tests, check your test caoverage, and generate an HTML coverage report:

$ docker-compose -f local.yml run --rm django coverage run -m pytest
$ docker-compose -f local.yml run --rm django coverage html
$ open htmlcov/index.html

Running tests with py.test

$ docker-compose -f local.yml run --rm django  pytest

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.

Deployment

This application is hosted on Heroku.

See detailed cookiecutter-django Heroku documentation.

Settings

Moved to settings.