Marine Corps barracks still uses paper logbooks to check in / out Marines who want to go on liberty on or off base. This is a simple docker django application that works with a scanner that reads in a military Common Access Card and helps automate the process of checking in and out without the need of the Marine on duty to fill out a single physical logbook. This is meant to run on a local machine.
- Use Data Science Pandas for simple metrics evaluation for Reports tab
- Connect to Github Actions
- Convert to backend (Django API) and frontend (React) Single Page Application
docker-compose up --build
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Docker: Get Docker
- Python: Get Python
- Install Docker and Python
- Download this repository
git clone https://github.com/phansiri/check_in_check_out_bks.git
- Create an
.env
file inside thecico_project
directory that contains the below example:
DJ_DEBUG=True
DJ_SECRET_KEY=super_secret_key
DJ_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] 0.0.0.0
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=cat_database_name
SQL_USER=super_cool_user
SQL_PASSWORD=super_secret_password
SQL_HOST=db
SQL_PORT=5432
- Create an
.env.db
file inside thecico_project
for the environment variables to create the database inside the postgres image.
POSTGRES_DB=cat_database_name
POSTGRES_USER=super_cool_user
POSTGRES_PASSWORD=super_secret_password
-
Ensure the information for the databases are the same between the
.env
and.env.db
-
In the root of the repo on the command line, type
docker-compose up --build
-
You will notice that your database will probably not exist
- Run:
docker-compose down -v
This will removed the persistent stored volume - Run
docker-compose up --build
and it ought to apply. - In a different terminal, run to ensure models are in the database:
docker-compose exec web python manage.py migrate
- If it asks you to make migrations first, run:
docker-compose exec web python manage.py makemigrations
- If it asks you to make migrations first, run:
- Run:
-
Open http://localhost:8000 A step by step series of examples that tell you how to get a development env running
- To run tests, ensure the docker-compose is up with
docker-compose up
- After it is up and running, open another terminal and run:
docker-compose exec web python manage.py test
- In order to see the admin backend, a super user must be created by running:
docker-compose exec web python manage.py createsuperuser
- Bootstrap - Front-end open source toolkit
- Django - High-level Python Web framework
- Docker - Containerization
- Django Docker Start
- Django Girls Tutorial
- Django, Postgress, Gunicorn, and Ngnix steps
- Django with Env
docker-compose exec web python manage.py startapp cico_app
docker-compose exec web python manage.py test --parallel
docker-compose exec web python manage.py createsuperuser
docker-compose exec web python manage.py makemigrations
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py check --deploy
docker-compose up --build
docker-compose down
- Entrypoint.sh must be executable:
chmod +x entrypoint.sh