Module Title: dgt_wrk09 – The Accolli (Easter Egg)
Description:
“dgt_wrk09 – The Accolli (Easter Egg)” covers the use of Flask, a Python web framework, to build projects for managing “Accogli” (accommodations or shelters). It is intended for those who build applications that handle data management and user interactions in settings such as hostels, shelters, or any accommodation service.
True to the Academy’s approach, no Python is typed by hand here. You learn how Flask routing, templates, SQLAlchemy models, sessions and REST APIs work; then you describe the application to the machine feature by feature (“a page listing the available beds, editable only by logged-in staff”), and you review what it writes: the routes, the models, the authentication checks. You run it, try to break it, and ask for corrections until the app behaves as specified.
Module Objectives:
- Understand Flask Basics: Understand Flask’s core features, including routing, templates, forms, and sessions.
- Database Integration: Learn how databases are integrated with SQLAlchemy to manage complex accommodation data, and how to check the models the machine proposes.
- User Authentication: Understand secure authentication well enough to specify it precisely and verify that only authorized users can reach protected functionality.
- RESTful API Development: Design RESTful APIs that connect front-end and back-end, have the machine implement them, and test that every endpoint behaves as intended.
- Data Visualization: Direct the machine in using tools like Chart.js or Plotly to create visualizations of accommodation data.
- Security Best Practices: Understand the security measures that protect user data and application integrity, and review the machine’s code against them.
Module Contents:
- Introduction to Flask
- Having the machine set up your development environment, and understanding what it installed
-
Basic concepts: routes, views, and templates
-
Building a CRUD Application
- Specifying how accommodation records are created, read, updated, and deleted, and verifying the result
-
Integrating with databases using SQLAlchemy
-
User Management
- Describing user registration and login, and reviewing how the machine implements them
-
Managing sessions and cookies for authentication
-
Developing RESTful APIs
- Designing API endpoints for CRUD operations
-
Handling HTTP methods and status codes
-
Enhancing User Experience
- Form validation and error handling
-
Using AJAX for asynchronous data updates
-
Data Visualization
- Integrating Chart.js or Plotly to display accommodation statistics
-
Creating dynamic dashboards
-
Security in Flask Applications
- Protecting against common web vulnerabilities, and spotting them in generated code
-
HTTPS and secure cookies
-
Deployment Strategies
- Preparing your application for production
- Instructing the machine to deploy on platforms like Heroku, AWS, or DigitalOcean, and checking the deployment
Target Audience:
- Beginner to intermediate Python developers interested in web development.
- People working in the hospitality sector who want custom solutions.
- Developers who want to get better at building scalable, secure web applications by guiding the machine and reviewing its code.
Prerequisites:
- Basic understanding of Python, enough to read the code the machine writes
- Familiarity with HTML, CSS, and JavaScript is beneficial but not required
By the end of this module, participants will have the knowledge needed to describe, direct and verify Flask applications for managing accommodations.
The students can push their exercises to the Academy DevOps & SRE Git project. For this module, create a folder with your username as its name in the following subfolder: https://github.com/Garanti-Del-Talento/gdt_academy
