Skip to content

Latest commit

 

History

History
84 lines (53 loc) · 2.57 KB

CONTRIBUTING.md

File metadata and controls

84 lines (53 loc) · 2.57 KB

Contributing

Getting started

  1. First, clone this project
# With SSH
git clone git@github.com:The-Peoples-Pantry/website.git

# or with HTTPS
git clone https://github.com/The-Peoples-Pantry/website.git

Running the application

This application can be run within a Docker container, or with Python on your host machine. You might prefer the Docker approach if you're not used to running Python applications locally. You might prefer the Python approach if you're comfortable with Python applications and configuring virtual environments and pip requirements.

With Docker

  1. Build and run the Docker image
bin/docker-devserver
  1. Access the server at http://0.0.0.0:8000

If you need to run any other commands using the application (such as test commands, migrations, etc) you can execute them within the running Docker container using bin/docker-shell

With Python

  1. Make sure you have the correct version of Python installed
python --version
# Should report version 3
  1. (Optionally) If you don't have the correct version of Python installed, install it using pyenv

  2. Run the setup script to create a virtual environment, install dependencies, and run migrations:

bin/setup
  1. Run the dev server (by default it listens on port 8000)
bin/devserver
  1. Access the server at http://0.0.0.0:8000

Writing & Running Tests

The full test suite can be run with:

bin/test

Django has extensive documentation on testing practices, and we ask that contributors add tests with their functionality.

In addition to functional tests, we also test our style using the flake8 and black linting tools. They can be run together with:

bin/lint

If any style violations are detected, they'll be printed to the console. black ensures that our code is written in a consistent fashion, and can automatically format your code with bin/format.

Pull requests

Contributors can suggest changes through GitHub Pull Requests (PRs), we use GitHub actions to automatically run our test suite against each PR to ensure that the change does not break anything.

When a PR is merged, it will be automatically deployed to Heroku and you can expect it to be live on the website within 5 minutes.