Project description
A web app for my precious daughter Zadia to Log her sleeping duration, eating hours. With this app you can: - Log sleeping start time and end time, it will show the duration time automatically -Log eating start time, end time and amount, it will display the summary -By day, it will display the summary of sleeping and eating. -
Project steps
Add StepsStep description:
Create models for eating and sleeping. The hard part is to calculate the duration based on start_time and end_time fields.The way I calculate is: - I convert the time object to datetime object by datetime.combine(), because the datetime is subtractable. - Once i can perform the subtract operation, I just need to subtract the start_tome from end_time - The same for both eating and sleeping
Issues and solutions
Add IssueStep description:
I had several key views for the backend. -Sleep/eat log: To get the input from the users for the database fields, it is a standard Request.POST method -Daily summary: This is where I get the input data from the database and display them as a summary. I want to perform sum() functions to all duration so that I can get the total hours of sleeping and eating every day as a summary. -Login/Logout: Django built on authentication login/logout class
Issues and solutions
Add IssueStep description:
Created the templates for login/logout, eating input, sleeping input and summary. - The summary one is a bit complicated, others are quite straightforward.
Issues and solutions
Add IssueStep description:
- I have done this several times, so I become quite familiar for the processes. Specifically: - Once git clone my repo from github, create virtual env and install all dependencies from requirement.txt files. - Create gunicorn socket( to connect gunicorn with nginx), and gunicorn service file( to connect django application with nginx). -Set up nginx configuration. - Some details can be found here. https://medium.com/@ganapriyakheersagar/hosting-django-application-with-nginx-and-gunicorn-in-production-99e64dc4345a
Issues and solutions
Add Issue