chaosdorf / chaospizza

🍕😎
MIT License
9 stars 2 forks source link
django-application food-delivery-order

chaospizza

Build Status Coverage Status

This repository contains a django web project that provides a simple way to coordinate food delivery orders.

System Context

A coordinator can announce a food delivery order and then tell other people to add food requests. When the coordinator decides to place the order, food requests are frozen and can't be changed anymore. Finally, people pay, food is delivered, everyone is happy.

System Context Diagram

Development

Software required:

To setup the development environment:

  1. Create build image: make build-image
  2. Start database: make start-db

Linting

Run linters:

$ make lint

Testing

Run tests:

$ make test

Pass additional parameters to pytest, e.g. to only run model tests:

$ TESTOPS='-k test_models' make test

Run a shell using the build image (access manage.py, etc):

$ make dev-shell

When using the django test client, make sure to run the following lines first:

import django
django.test.utils.setup_test_environment()

Web server

Create database schema:

$ make migrate

Run the django development server:

$ make run

The application is available at http://localhost:8000.

Django admin:

The admin user must be created via python manage.py createsuperuser.

Python requirements

Requirements are managed via pipenv.

Environment variables

The django application requires a set of environment variables to be configured. For development, only DJANGO_DATABASE_URL is required and can be configured by e.g. direnv.

Deployment

The project provides a docker container to runs the django application in gunicorn. For production, the following parameters must be configured:

Optional parameters: