Search
Contents
22.
Refill the Flask
22.
Refill the Flask
ΒΆ
22.1. HTML Escaping
22.1.1. Escaping Text Entries
22.1.2. Always Escape
22.2. Jinja3 Templates
22.2.1. More Reasons for Using Templates
22.3. Chapter Practice
22.3.1. Pro Tip!
22.4. Adding Logic to Templates
22.4.1. Loops in Templates
22.4.1.1. Using Index Values
22.4.1.2. Placement Matters
22.4.2. Try It!
22.4.2.1. Bonus Try It!
22.4.3. Check Your Understanding
22.5. Conditionals in Templates
22.5.1.
if/elif/else
Syntax
22.5.2. Try It!
22.5.2.1. Add the Conditional
22.5.3. Check Your Understanding
22.6. Reusing Content
22.6.1. A
base
Template
22.6.1.1. Block Out Space for Other HTML Code
22.6.2. Extending From the Base
22.6.3. Add A Common Header
22.6.3.1. Finishing Touches
22.6.4. Extend
base
to a Second Page
22.6.5. Multiple Blocks
22.6.6. Video Summary
22.6.7. Check Your Understanding
22.7. Page Navigation
22.7.1. A List of Links
22.7.2. Bring in Some Logic
22.7.2.1. Update
main.py
22.7.2.2. Update
base.html
22.7.3. A Dropdown Menu
22.7.3.1. CSS Breakdown
22.7.4. Navigation Bar and Other Options
22.8. Redirecting
22.8.1. Render Template vs. Redirect
22.8.2. Redirect with Flask
22.8.3. Difference Summary
22.8.4. Redirect Methods
22.8.4.1. Response Codes
22.8.4.2. Technical Details (Optional)
22.8.5. Check Your Understanding
22.9. The User Experience
22.9.1. Explore UX
22.9.2. Other Reading
22.9.3. Check Your Understanding
22.10. Exercises: Logic In Templates
22.10.1. Setup
22.10.2. Part A: Extend from
base.html
22.10.3. Part B: Add a Loop
22.10.3.1. The
choices
Dictionary
22.10.3.2. Update
grid.html
22.10.4. Part C: Add a Conditional
22.11. Project: Improve the User Experience
22.11.1. Setup
22.11.1.1. Run the Application
22.11.2. Part A: Clean Up the View
22.11.3. Part B: Keep Valid Entries
22.11.3.1. Update
register.html
22.11.3.2. Update
main.py
22.11.4. Part C: Display Error Messages
22.11.5. Part D: Redirect on Success
22.11.6. Bonus Mission
←
21.10.
Project: Web Form (Part 2)
22.1.
HTML Escaping
→