entnero.blogg.se

Food calories calculator
Food calories calculator










food calories calculator
  1. #Food calories calculator install#
  2. #Food calories calculator mac#
  3. #Food calories calculator windows#

This field is connected to PostFood class by a through argument. Last field is all_food_selected_today for storing all the foods consumed in a day. Date field is given to keep track of calorie consumption each day. We got fields like calorie_count for counting calories for each day, food_selected for the food that the user selects for consuming, calorie_goal for setting a goal for calorie consumption each day. This is the main model that stores all the required data of the user for tracking calories. Each user is connected so that users can have food inventory of their own choice. This model is made for storing all the food items that the user wants in their profile. I am going to describe the functionality of each Model class. Okay, our boring setup is out of the way lets get to the fun coding part. Change “DIRS” and add static file location at the bottom. (calorieapp-kub3HwmJ) C:\Users\User\Desktop\calorieapp>mkdir templates (calorieapp-kub3HwmJ) C:\Users\User\Desktop\calorieapp>mkdir staticĪ tweak is needed in settings.py file for letting django know to use our files that we made above. Now to add templates folder for storing all our templates for the project also we need a static folder for storing static files like CSS/JS. Now add the apps in settings.py file INSTALLED_APPS = Ĭhange time zone according to your location which you will find at bottom part of settings.py.

#Food calories calculator install#

(calorieapp-kub3HwmJ) pip install django-filter Now let's install django-filter package which we will need a bit later. (calorieapp-kub3HwmJ)python manage.py startapp calories pipenv install django pipenv shell (calorieapp-kub3HwmJ) django-admin startproject calorie_app. I will try to keep it short since you can easily find tutorials for setting up django project. Go to the location you prefer on your computer from the command line and start.

#Food calories calculator mac#

If you are on Mac or Linux the process is almost the same with some command line changes, which you can easily find from the internet.

#Food calories calculator windows#

I have done this project on windows operating system. This might be a little hard for absolute django beginner, so basic knowledge of django will be helpful in understanding. Enough about other things, lets get to the coding part.

food calories calculator

I have been learning Django by myself for a while now so I thought it would be a good project to skill up my Django than following project tutorials. With this in mind, I thought how about I make a calorie tracker with python Django. So regular exercise and healthy diet is an important thing people are looking into. With the covid-19 outbreak this year it has been proved that covid-19 is more fatal to people with obesity. According to WHO in 2016, more than 1.9 billion adults, 18 years and older, were overweight. Maintaining a healthy lifestyle has been one of the main concerns of this century.












Food calories calculator