By the end of week 3, I had completed the following: I built webpages using the Django framework for a recipe website to show five webpages (Main, Recipe Page, Create Recipe, Edit Recipe, and Admin). This week we covered additional CSS and started our Django project. This was a four-day week because of the President's Holiday on Monday. Let's get into it!
Before we started on Django we spent the first day and half continually working on CSS. For example CSS selectors - various selectors, css specificity, pseudo-classes, alternative layouts, and using properties. Why is CSS important? It is used to style elements provide interactivity, and create a visual language.I learned that placing a basic 'CSS Reset' at the start of your CSS file is recommended. Please see the image below, shared by one of our technical instructors in the HR course.
In addition, we spent time working on Box shadows, Transitions and transforms and going over the CSS stylesheet showcasing grids in CSS. CSS uses selectors (.,#, and tag) and combinators (>, +). The Specificity rules allow CSS to decide what takes precedence for design based on what is being compared in your stylesheet. Helpful tips that I noted are the following. Keep your CSS specificity as low as possible, setting your default layout for all your tags, creating a particular CSS class, and using those. It is okay to have a lot of CSS classes, and choosing specific classes rather than descendant combinators is better.
Using PIP (the package management system for Python) and how using other people's code is a good and widely accepted practice of software development. To access others' code, we need to import and from/import to gain access.
On the second day of class, one of the lectures was on time and how it is used in programming. Here is a list of untrue statements on time presented in class.
"Time has no beginning and no end" This statement brought up a lengthy discussion between individuals in my cohort and the instructor on how we perceive time and reversing other famous thinkers like Einstein and Stephen Hawkings, or in the philosopher world, that time is continuous. That we do not experience a stop or a start. There is agreed-upon directional order of time in that there is a past to present to a future order of events we see and experience. Nonetheless, computer programming, for example, in Python, uses the datetime library and allows us to format our code into what is universally recognized with how time is kept track. From here, I learned how to make a birthday time function and compare dates utilizing the DateTime function.
On the third day of the week, we preceded to start our Django project by learning and creating the necessary steps to implement a Django project by doing the following steps:
I learned how a request and response cycle is complete. See the photo below of my diagram. It starts with a browser (client) making a request (web address) to a server. This server then finds the address and contacts our Django app, which has stored URL paths in code to help locate the correct HTML template to display. The view file on a Django website is the remote control to flip or change the website to the requested webpage.
And in the world of Developers, they follow (CRUD). Which stands for create, read, update, and delete. This is how many applications and websites operate, with create being a POST function, a read function being a GET, an update function being PUT, and a delete function being DELETE.
I learned about an error in my Django project this week and the solution required.This error happened because I did not input the correct id for the function I had built to display each unique Recipe from my database. Below is a picture from my views.py from inside my app Recipe. I identified the key in my content dictionary on line nine as recipe_list. This is the id I should have been using for Django to understand that I want the URL to travel to my edit.html and do so by displaying the specific Recipe associated with clicking through my detail.html page.
I have built out my Django project to have a database on the admin page and show and display four web pages. I can add to my list of recipes without having to login into my admin page and for it to be listed on my home/list page automatically. I'm excited about this project from the standpoint of learning the steps necessary for a working application. This reminds me of my time working on an API React project for facial recognition in the Zero To Mastery Complete Web Developer Course. I do see similarities when working with React and Django. The main ones would be all the steps involved in getting everything up and running. Still, the more you work on it, the stronger and more efficient you become in debugging, creativity, and building and developing your code to make it easy to understand. It is written for scalability (it can handle a large amount of input data, many users, or many nodes.). I do show a quick walk thru of my code so far in my week 3 YouTube update.
I would have to debug error codes that I received when running my localthost:8000. I had two errors that took several hours to resolve fully. This led to a deeper understanding of my Django project, and I am grateful and welcome errors in my code. This also led me to ask two instructors and SEIRS(software engineer immersive residents) about the mistakes for them to be resolved. I will take screenshots of my errors to reference later in my documentation.
I am continually building out my Django project and finishing getting the structure of my edit.html to display with the ability of a user to edit that Recipe. Improving my user interface, although I'm not very concerned with the appearance of my site, as I'm more focused on learning and understanding all the working gears that make the files in my Django app work and come together without errors. And lastly, creating a login ability for the user of the site. I see on the course calendar for this week, we will be learning about Django Two-Shot. I am still determining this at the time of writing, and it is another project.I look forward to sharing my findings and thoughts on this new and upcoming project next week! A reminder everything is "GOOD"! Referencing former Navy Seal Commander Jocko Willink.
Every day this week, I'm blessed to have weather that is sunny or cloudy but not raining, giving me plenty of opportunities to get outside, breathe air, and enjoy being a human being. I appreciate the moments I have to sit in my thoughts or breathe. This week, I do anywhere from 2-5 meditations daily. They range from 5 mins to 25 mins per session. Sometimes I will do a morning or evening meditation with my girlfriend. We have found this helps with our current life stresses and also helps to strengthen our relationship as a couple. I'm excited for my girlfriend, as she will be starting a new job this week, and we are still looking for another apartment to rent and use for an office. I live with her and her parents in an apartment, working from home. More space and a separate room/apt specifically for work would benefit both of us and our productivity. My sleep and food intake have been good, with three meals around the same time and only drinking water, Colombian coffee, teas, and freshly made juices from the local fruits in Santa Rosa de Cabal. My favorite that my Suegra(my GF's mom) makes is pineapple and Guayaba.
Also, my working out habits are every day during breaks in the course, or when I wake up early, I walk over to the soccer court in our complex where we live and perform various circuits of bodyweight, trx, and cardio movements. My focus during this course is maintaining lean mass, flexibility, and good posture. Later after we travel and are living in another environment, I plan on doing more resistance/weight training as one of the many routines I enjoyed when living in Medellin was going to CrossFit class at PowerClub in Ciudad Del Rio. And lastly, for this week's reflection and documentation, I have found myself in the unique situation of having the opportunity to get baptized in Santa Rosa de Cabal. Now I'm not affiliated with any religious beliefs/ties. My view on god is one of believing there is something much bigger than any human as far as higher energy or power. I do not want to go any further with this for now (a good representation of my beliefs can be found in this Wayne Dyer speech) , and I'll keep you updated next week to see if this is still possible during my time here in Santa Rosa de Cabal. Ciao y nos vemos!
I'd be happy to discuss your project and how we can work together to create unique, fun and engaging content.
Go ahead and click here to be taken to my business service page and see what I can do for you. Book a call with me now. Looking forward to chatting soon!