-
Notifications
You must be signed in to change notification settings - Fork 8
Home
This tutorial was developed with the support of the PDX Code Guild as a seminar project within the Advanced Portfolio program, for the session which began January 2018. The class offers students an opportunity to design and implement programming projects that stretch their current abilities and add important skills to their resumes. Students are encouraged to solve new problems with familiar technologies and/or to solve classic problems with new technologies. They're asked to research something new, and are guided in the implementation of a final portfolio piece that leverages that new ability. In short, they're challenged to demonstrate their ability to organize their work and learn in a collaborative, technical setting.
Given the seminar format of the class, I felt it was important to follow the course format myself, along with the students. Given the Code Guild's emphasis on Python, I also felt it was important to learn the language. I knew very little about Python at the beginning of this project. I've known there is a large ecosystem of Python-based development across multiple domains, but I didn't know which frameworks and libraries were most common or popular. Researching pythonic solutions in the web domain led more or less directly to Flask.
Like Django, which is taught in the Code Guild's introductory course, Flask is a common framework for full-stack web development. Unlike Django, however, Flask is a micro-framework. As demonstrated in the tutorial, a minimal Flask application can be launched with minimal dependencies very quickly. Dependencies are introduced only as needed, for instance when importing Flask Extensions. This is ideal for developing lean applications, and ideal for learning the details of required components.
The initial project requirements then were fairly simple. First, create a robust, containerized, web accessible, Flask development environment. Second, manage a minimum of two modular, related data objects with CRUD operations for all fields. MySQL was selected for the storage layer, and Boostrap with JQuery was selected for the presentation layer. As a challenge while following the tutorial, you could substitute PostgreSQL or Mongo for the database, or drop Bootstrap for a different materialized CSS framework.
To begin, you will need to install Docker. Then, in a new folder, create the four files described in Commit-v0.1. Finally, from the root of your new project issue the following command:
docker-compose up --build
For a listing of tutorial sections, code branches, and brief descriptions visit Contents.
- FlaskApp Tutorial
- Table of Contents
- About
- Application Setup
- Modules, Templates, and Layouts
- Database Items, Forms, and CRUD
- List Filter, Sort, and Paginate
- Users and Login
- Database Relationships
- API Module, HTTPAuth and JSON
- Refactoring User Roles and Item Status
- AJAX and Public Pages