The rest of the files listed on the diagram above form a template of an application.
|
The Spring Python application context used to wire the generated application using decorator-driven |
|
The main portion of the application that is runnable |
|
Contains the business logic of the application |
|
Contains some the CherryPy rendering parts of the application |
|
A subdirectory containing images used by the view layer of the application |
gen-cherrypy-app
listed, let's install it using coily
without touching a browser. sample_app
. Since we just installed it, the plugin now shows up on coily's
help menu. With that in place, we can then run the command to create sample_app
.
gen-cherrypy-app
creates a directory named sample_app
and copies the files listed above into it. It also does some transformations of the files, based on the argument sample_app
.
sample_app
directory, and run the main script../sample_app.py
app_context.py
and see some of the key features wired by gen-cherrypy-app
.This i s the root object being wired. The rest of the confi guration (not shown here) is mostly security confi guration steps.
In Chapter 6, Securing your Application with Spring Python, it was pointed out that security configuration with Spring Python requires many steps. gen-cherrypy-app
helps out by pre-wiring most of the security parts, allowing the user to modify as needed rather than build from scratch.
From here, we can log in with the hard-wired credentials to view our expandable application.
Currently, there are no controller objects. However, it would take little effort to add such a layer, as demonstrated in the previous chapter's case study.
This plugin is simple enough that most of the work spent in improving this plugin can be focused on the template files. This tactic is very useful to build other templates for other types of application.
18.218.189.173