Cheat Sheet¶
If you only remember one thing, remember this: you can type the long command, or you can type the short command and get back to building your app.
Naming conventions¶
Flask-Commands assumes a few conventions. They are simple, and they save you from surprises later.
Views use dotted names and are pluralized by convention (for example,
posts.comments.images.showorcomponents.buttons).Controllers use PascalCase (Upper CamelCase) and are singular, ending in
Controller(for example,PostCommentImageController).
Common patterns¶
Pattern |
What it does |
|---|---|
|
Scaffold a new Flask project. |
|
Create a template only (no wiring). |
|
Create a template and wire up a route + controller method. |
|
Create a template and wire up route + controller + model (when it makes sense). |
|
Create a controller, routes, and templates for the seven RESTful actions. |
|
Create a controller, routes, and templates for the seven RESTful actions, plus a model. |
|
Create a model and register it in |
|
Create a model plus RESTful controller, routes, and views. |