make:controller Videos#
This page collects the controller-first workflow. It covers simple controller creation, RESTful scaffolding, controller-driven model generation, and the structure choices that come up when the workflow gets more complex.
Use these cards to move through the controller-first path and keep your watched progress saved locally in the browser.
flask make:controller#
Intro To Flask Make Controller Unwatched
When it makes sense to start from controller behavior and how make:controller helps scaffold the layer that coordinates routes, templates, and models.
If the embed does not load, watch on YouTube: Intro To Flask Make Controller.
The Basics of make:controller#
A simple controller Unwatched
How to start with the controller layer directly when the behavior feels clearer than the page or model structure at the beginning.
If the embed does not load, watch on YouTube: A simple controller.
Add RESTful actions with --crud Unwatched
How the controller generator expands into a full RESTful action set so you can scaffold behavior in one pass instead of method by method.
If the embed does not load, watch on YouTube: Add RESTful actions with --crud.
Why --crud Feels Like A Big Deal Unwatched
Why the --crud flag is such a useful jump in scaffolding power when you want the full RESTful controller, route, and template shape at once.
If the embed does not load, watch on YouTube: Why --crud Feels Like A Big Deal.
Controllers and Models with make:controller#
Add a model with --model or -m Unwatched
The difference between the explicit long flag and the shorthand model-generation path so the command does exactly what you intend.
If the embed does not load, watch on YouTube: Add a model with --model or -m.
Name the Model Directly Unwatched
How --model lets you choose the exact model name instead of asking Flask-Commands to infer one from the controller name.
If the embed does not load, watch on YouTube: Name the Model Directly.
Generate the Model Name Unwatched
How -m asks Flask-Commands to generate a model name from the controller name and when that shorthand is clear enough to use.
If the embed does not load, watch on YouTube: Generate the Model Name.
Why Both Options Matter Unwatched
Why explicit model naming and generated model naming both matter once controller names start carrying namespaces, multi-word models, or relationships.
If the embed does not load, watch on YouTube: Why Both Options Matter.
Generating a RESTful Controller with a Model Unwatched
Watch --crud and -m work together to create a RESTful controller, routes, templates, and a registered model from one controller-first command.
If the embed does not load, watch on YouTube: Generating a RESTful Controller with a Model.
The Naming Problem Unwatched
The three naming stories Flask-Commands has to separate: one multi-word data structure, a namespace, and a nested resource relationship.
If the embed does not load, watch on YouTube: The Naming Problem.
Single Data Structures that are Multiple Words Unwatched
How to keep names like ShoppingList together as one model-backed resource instead of accidentally turning the words into nested structure.
If the embed does not load, watch on YouTube: Single Data Structures that are Multiple Words.
When to Namespace Unwatched
When a leading name segment is better understood as an organizing namespace rather than a model or parent resource.
If the embed does not load, watch on YouTube: When to Namespace.
Multi-Word Namespaces Unwatched
How multi-word namespaces map to route packages, endpoint names, and URLs while staying separate from the model name itself.
If the embed does not load, watch on YouTube: Multi-Word Namespaces.
Public Pages and Private Tools Unwatched
How namespaces can separate public resource pages from private tool surfaces that manage the same underlying model.
If the embed does not load, watch on YouTube: Public Pages and Private Tools.
Naming Nested Controllers by Relationship Unwatched
How nested controller names describe parent-child relationships and how that relationship appears in generated routes and folders.
If the embed does not load, watch on YouTube: Naming Nested Controllers by Relationship.
Flat vs Nested with make:controller#
Flat or Nest with the ``-m`` Option Unwatched
What the structure choice means inside the controller-first workflow so you can pick the layout that matches your app instead of accepting a default blindly.
If the embed does not load, watch on YouTube: Flat or Nest with the ``-m`` Option.
Choose Flat for One Multi-Word Model Unwatched
How --flat keeps a multi-word controller resource together as one model-backed structure when the words describe a single thing.
If the embed does not load, watch on YouTube: Choose Flat for One Multi-Word Model.
Build Nested Resources One Level at a Time (make:controller) Unwatched
Why building nested controller resources from the top down keeps generated parents, children, routes, and prompts easier to reason about.
If the embed does not load, watch on YouTube: Build Nested Resources One Level at a Time (make:controller).
Combine Namespaces with Nested Model Generation Unwatched
How controller namespaces and nested model generation can work together when part of the name organizes the app and part describes data relationships.
If the embed does not load, watch on YouTube: Combine Namespaces with Nested Model Generation.