The Monday Night Lights Hockey League API built for managing Teams, Players, Seasons, Games, and more.
This application can be run using Docker. If you cannot install Docker, a Vagrantfile is provided for provisioning a Debian virtual machine.
To get started, clone the repository. Then make a copy of template.env and rename it .env.
$ git clone [email protected]/mnlhl:mnl.git
$ cd mnl
$ cp template.env .env # variables are preset for dev but should be changed in production
-
Install Docker and Docker Compose
-
Build and run the application containers using docker-compose:
$ docker-compose up --build -d -
View the running application in a browser at https://localhost
When you need to run a command inside a container, use:
docker-compose exec container_name <command>
Or you can run a shell to enter the container and run commands inside
docker-compose exec container_name /bin/sh
# <command>
-
Install VirtualBox and Vagrant
-
Add the vagrant-docker-compose Vagrant plug-in and run the development VM:
$ vagrant plugin install vagrant-docker-compose $ vagrant up -
View the running application in a browser at https://172.16.0.2
The unit tests can be run with:
python manage.py test
An admin user can be added for development by running:
python manage.py createsuperuser
We are using Pipenv to manage Python dependencies. This means there is a
Pipfile instead of the traditional requirements.txt file. To install
or update Python packages, run:
pipenv install <package_name>
pipenv update
pipenv install --dev --system
This will update Pipfile.lock with the new version numbers, and then
install the packages globally within the django container.
Note: Since we are using a self-signed certificate for SSL in development, your browser will warn that the page connection is insecure. Bypass the warning by clicking "Advanced" and adding an exception for this certificate.
To use AWS S3 for storing static files and user uploaded media, set the AWS
environment variables. The Django app will detect them and use the AWS storage
backends. If AWS_STORAGE_BUCKET_NAME is not set, Django's default storage
backends will be used. For more info, see
https://testdriven.io/blog/storing-django-static-and-media-files-on-amazon-s3/.
- Docker
- Docker Compose
- Vagrant
- debian/contrib-stretch64
virtual box (
contrib-*boxes include thevboxfskernel module for shared folders) - nginx
