Skip to content

BMI Calculator Python - simple website creating with Django (built from scratch by myself).

Notifications You must be signed in to change notification settings

olczi095/bmi-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

⚖️ BMI Calculator

The website provides a set of basic functional calculators, including:

  • 🧍‍♂️ BMI calculator - Body Mass Index
  • 🧘‍♀️ BMR calculator - Basal Metabolic Rate
  • 🏋️‍♂️ PAL calculator - Physical Activity Level
  • 🏃‍♀️ TMR calculator - Total Metabolic Rate

The project allows users to save their data, including for example current BMI value and user biometric data such as weight, height, etc., for future reference, which can particularly useful especially during weight loss or weight gain journeys. Additionally, the project offers three types of APIs: one for data manipulation (for 'Person' and 'CalculatedData' models in the database) and two for calculating BMI, BMR, and TMR values.

Overview

Honestly despite my interests in healthy lifestyle, I have never seen a website that offers all these useful and essential calculators.

All these calculators are so helpful in losing / gaining / maintaining weight so I decided to bring them all together and create a comprehensive website with each useful tool.

The website is designed to be clear user-friendly. I've also put some effort to providing additional verified and effective information.

Requirements

Python 3.0 or any higher version

Installation

1. Clone the repo at first:

  git clone https://github.com/olczi095/bmi-calculator.git

2. If you want to create the virtual environment particularly for that project and connect with it:
  python3 -m venv venv
  venv\Scripts\activate # on Windows
  source venv/bin/activate # on MacOS/Unix

3. Change to the project directory:
  cd mysite

4. Install the required dependencies:
  pip3 install -r requirements.txt

5. Create a ".env" file and place the following code in it. Generate your own unique secret key and replace the key provided in the below code. Also, change the value of DEBUG to "True" or "False":
  SECRET_KEY=your_own_secret_key_here
  DEBUG=true_or_false

6. Run the development server:
  python3 manage.py runserver

The website will be available in browsers at:
  http://localhost:8000/

Features

  • Fast calculating of BMI, BMR and TMR values without the need to log in or register

  • Checking the table with detailed PAL values

  • Discover very useful info about losing weight/gaining weight etc.

  • Creating an account (register) and log in / log out

  • For registered and logged in users additional great options:

    • saving the submitted data (e.g. weight or height) in account for possibility to using them next time
    • saving the calculated values (e.g. BMI value) to check them next time and for example to compare last and current weight and notice the progress

API

Person Model API

The API for the 'Person' model which utilizes ViewSets and token-based authorization. It allows admin to perform CRUD operations, while allowing owners to read and update their own 'Person' instances.

CalculatedData API

The CalculatedDataAPI utilizes token-based authorization. It includes two classes: 'CalculatedDataListView' for listing data with admin permissions, and 'CalculatedDataDetailView' for retrieving and deleting individual instances with owner or admin permissions.

Functional API

A more functional API built on class-based views used for calculating BMI, BMR and TMR values, based on provided information, available for everyone.

Screenshots


main website with BMI calculator for any users ↓


Basic Website


TMR calculator for logged-in user ↓


Basic Website 2


BMI result for logged-in user ↓


PAL Calculator


PAL table with some info ↓


PAL Calculator

Authors

🙋🏻‍♀️ If you have any idea how to improve or modify my project, contact me!

About

BMI Calculator Python - simple website creating with Django (built from scratch by myself).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published