So we have already created a model and added a handler to our todo app. If you haven't done this so far just follow the links. It also just takes a few minutes to set this all up. Cause this is the idea of PythonOnWheels, to make the basic things as easy as possible to focus on the app, not on the boilerplate.
We are now at the frontend part. This is the views part in the terminology of MVC structured apps. As usual in PythonOnWheels we use a generator to create the scaffolding of a web frontend for us. Just as for the handler the convention is that the generator will produce views for the typical REST routes we just created in our handler. As of today PoW supports bootstrap 4 and semanticUI as frontend frameworks. Bootstrap 4 is the default.
To create a scaffolded view you execute the generate_scaffold.py generator and give it the handler name it should link to with -n handler_name and the view-type it should generate with -t bs4 (for bootstrap 4 or sui for semanticUI). So execute this to generate a whole set of views for all our REST methods.
python generate_scaffold.py -n todo -t bs4And you should see the following result:
You can see that generate_scaffold created five views for us. Namely show, list, page, edit and new. We also get delete as a functionality on the list view as you will see but since this "only" deletes there is just a button for that and no dedicated view.
python server.py
http://localhost:8080/todo
What you can see in the screenshot above is the list view. You can access it with the REST route:
http://localhost:8080/todo
This is the main entry point to manage our data. From here you can create, show, edit and delete data. So all the CRUD functions are available right here.
You have come pretty far. You have created a model, added a handler, and now you also added a complete web frontend. And all this without any configuration, installation, setups or any boilerplate. Just right there to your app. What has been created for you is just based on the standard libraries below pow_home. Like tornado, sqlalchemy and so forth. So you can now adapt your app to your need.
Most probably you will add some handler methods to do custom things with your data. And you will adapt the views or create new views to make your app look beautiful and enhance usability. The scaffolding is more ment for developers to get an easy (and nice) access for data management.