- First, clone this project
# With SSH
git clone [email protected]:The-Peoples-Pantry/website.git
# or with HTTPS
git clone https://github.com/The-Peoples-Pantry/website.git
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.
- Build and run the Docker image
bin/docker-devserver
- 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
- Make sure you have the correct version of Python installed
python --version
# Should report version 3
-
(Optionally) If you don't have the correct version of Python installed, install it using pyenv
-
Run the setup script to create a virtual environment, install dependencies, and run migrations:
bin/setup
- Run the dev server (by default it listens on port 8000)
bin/devserver
- Access the server at http://0.0.0.0:8000
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
.
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.