Skip to the content.

Day 1: Introduction to Flask, Jinja2, HTML/CSS, and Setup

Coding (2 PM - 4 PM)

Here's why we used Bootstrap over traditional CSS and information on how to get and use CDN links:

Why Use Bootstrap Instead of Traditional CSS?

Bootstrap is a popular CSS framework that provides pre-designed components and a responsive grid system. Here are the key reasons for using Bootstrap in this context:

What is a CDN?

CDN stands for Content Delivery Network. It is a system of distributed servers that deliver web content, like CSS or JavaScript libraries, based on the user's geographic location. The main benefits include:

  1. Visit the Bootstrap website: Go to getbootstrap.com.
  2. Navigate to the "Get Started" section: Copy the CSS and JavaScript links provided for quick integration.
  3. Insert the CDN link in your HTML <head>: This allows your page to pull Bootstrap directly from the web.

Example of Including Bootstrap via a CDN:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">

This link loads the Bootstrap CSS directly from a CDN, so you don’t need to download and host it locally.

What is Jinja2?

Jinja2 is a template engine used in Flask for rendering dynamic web pages. It allows you to embed Python-like expressions in HTML, making it easier to generate complex HTML structures.

Why Use Jinja2?

Jinja2 has several advantages over other template engines:

How to Use Jinja2 in Flask?

  1. Import Jinja2: Import the render_template function from the flask module.
  2. Render Templates: Call render_template() to load and render templates.
  3. Pass Data: Pass data to the template using keyword arguments.
  4. Template Variables: Jinja2 allows you to use variables in your templates. You can access the data passed from app.py using the {{ }} syntax.

Prep/Doubt Clearing (4 PM - 5 PM)

Here are some excellent HTML and CSS resources for beginners:

HTML Resources:

  1. W3Schools - HTML Tutorial

    • A beginner-friendly resource that covers all the basic concepts of HTML with interactive examples and exercises.
  2. MDN Web Docs - HTML Basics

    • Mozilla’s comprehensive documentation, starting with an overview of HTML and progressing to more advanced topics. It’s great for both learning and referencing.
  3. freeCodeCamp - HTML and HTML5

    • Offers a free interactive course covering HTML basics and advanced concepts. It’s practical and allows you to build projects.
  4. HTML.com

    • A simple, straightforward resource with tutorials that break down HTML concepts in an easy-to-understand manner.

CSS Resources:

  1. W3Schools - CSS Tutorial

    • A great resource for beginners that covers all CSS properties and concepts with examples and exercises.
  2. MDN Web Docs - CSS Basics

    • MDN offers in-depth documentation with examples on CSS properties, selectors, and layouts, perfect for learners of all levels.
  3. freeCodeCamp - CSS

    • Another free, interactive course that helps you learn CSS, starting from the basics and advancing to responsive design techniques.
  4. CSS-Tricks

    • Provides a series of guides and articles on various CSS topics, ranging from beginner to advanced. Includes practical examples and tips.
  5. The Net Ninja - CSS Tutorials (YouTube)

    • A YouTube playlist with clear and concise CSS tutorials for beginners. Great if you prefer video tutorials.

Interactive Learning:

  1. CodePen

    • A platform where you can write and experiment with HTML, CSS, and JavaScript. It's a great way to practice and see your changes in real-time.
  2. CSS Diner

    • A fun game to learn and practice CSS selectors, perfect for beginners who want to engage with the learning process.
  3. Flexbox Froggy

    • A fun way to learn CSS Flexbox, a layout model that’s very useful in modern web design.
  4. Grid Garden

    • Similar to Flexbox Froggy, but for learning CSS Grid layout. It’s an interactive way to master CSS Grid.

Books for Beginners:

  1. "HTML and CSS: Design and Build Websites" by Jon Duckett

    • A visually appealing and easy-to-follow book for beginners, offering clear explanations and practical examples.
  2. "Learning Web Design" by Jennifer Niederst Robbins

    • A comprehensive guide to HTML and CSS, starting with the basics and advancing to more complex topics. Perfect for new learners.

By exploring these resources, you'll gain a solid foundation in HTML and CSS, and you’ll be ready to apply your skills in web development projects.