Flask-Commands
Scaffold Flask apps in seconds.
Skip the boilerplate and get straight to coding. Flask-Commands plugs into Flask’s CLI so you can scaffold projects and app structure without a separate toolchain.
% flask make:model Post --crud
✅ Success: Created Controller Class
- Created a new controller called PostController
- New controller located at app/controllers/post_controller.py
- Registered PostController at app/controllers/__init__.py
- Added controller methods: index, show, create, store, edit, update, destroy
✅ Success: Created New Model
- Created model Post at app/models/post.py
- Registered Post model at app/models/__init__.py
✅ Success: Created New Route Directory
- Created __init__.py at app/routes/posts/__init__.py
- Created routes.py at app/routes/posts/routes.py
- Registered the new route directory as posts_blueprint at app/__init__.py
- Added route functions: index, show, create, store, edit, update, destroy
✅ Success: Generated CRUD Wiring
- index (GET)
Added view file at app/templates/posts/index.html
Visit the new route at /posts
Reference this route with url_for('posts.index')
- show (GET)
Added view file at app/templates/posts/show.html
Visit the new route at /posts/1
Reference this route with url_for('posts.show', post_id=1)
- create (GET)
Added view file at app/templates/posts/create.html
Visit the new route at /posts/create
Reference this route with url_for('posts.create')
- store (POST)
Reference this route with url_for('posts.store')
- edit (GET)
Added view file at app/templates/posts/edit.html
Visit the new route at /posts/1/edit
Reference this route with url_for('posts.edit', post_id=1)
- update (POST)
Reference this route with url_for('posts.update', post_id=1)
- destroy (POST)
Reference this route with url_for('posts.destroy', post_id=1)
Why Flask-Commands?
⚡
Fast Scaffolding
Commands for scaffolding a working Flask project, and wiring your application's data.
📂
Plain Files
Generated clean files ready to edit so you still own your application's files.
😇
Honest Nesting
Neatly nested structure for routes, models, and controllers that represent your data structures.
🧱
Less Boilerplate
Spend less time typing boilerplate code in your routes, controllers, views, and models.
Get Started in 3 Easy Steps
1. Create a new Flask project
2. Move into your project directory
3. Generate a resource
$ flask new myproject
$ cd myproject
$ flask make:view posts.index -rcm
In three commands, Flask-Commands takes you from zero to generating routes, controllers, models, and views for your application.