Daily Reading 26
Intro to Django
###
What are the key components of the Django framework, and how do they contribute to building a web application?
Django is a web framework based on python that is intended to be an easy to use broad toolset for website development. Core ideals behind Django include “batteries included” approach to web development, where all of the extended requirements for making something are available and easy to implement as needed. For example, if you need to make a login system, then password hashing, authentication, sql inject protection, and systems for serverside saved data are all available and ready for use.
“Don’t reinvent the wheel,” is a phrase used several times in the design documents for Django.
Explain the role of Django’s MVT (Model-View-Template) architecture and how it handles a typical web request-response cycle.
I’m a little shakey on the details from what I’ve read so far, but it sounds like the HTTP requests go through urls.py for sorting, and are routed into the appropriate “view” from views.py. views.py is responsible for communicating with models.py for data read or write requests, and is also responsible for providing the http response. Views also uses templates, which are HTML files that have blanks where certain data should go, and views is responsible for substituting in the relevant data before returning the HTML to the user.
What is the purpose of Tailwind CSS, and how does it differ from Bootstrap CSS?
Tailwind is a CSS framework, with a heavy focus on what is called Utility Classes. Tailwind utility classes are things such as a button class that take in many optional arguments, passed in via the format of a space demarcated string. For example button class="varA-4 varB-5 varC-apple text-green"
The use of this formatting, and general purpose of Tailwind is to let you create customized website elements, while creating as little bespoke custom CSS as possible, using only html elements with arguments as discussed above. Tailwind is lower-level than most other frameworks such as bootstrap, so more precisely customized unique websites are possible with tailwind where they aren’t with Bootstrap.